ctrlv.sk - auto close banner window

For automatic closing banner window

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            ctrlv.sk - auto close banner window
// @name:sk         ctrlv.sk - automaticky zavrie reklamný baner
// @name:cs         ctrlv.sk - automaticky zavře reklamny baner
// @namespace       https://greasyfork.org/users/1103427-sperhak
// @homepageURL     https://greasyfork.org/sk/scripts/474295
// @supportURL      https://greasyfork.org/sk/scripts/474295/feedback
// @version         1.1
// @description     For automatic closing banner window
// @description:sk  Pre automatické zavretie reklamného baneru
// @description:cs  Pro automatické zavřetí reklamního baneru
// @author          Sperhak
// @match           *://*.ctrlv.sk/*
// @grant           none
// ==/UserScript==

(function() {
    'use strict';

    // Hladaný text
    const searchText = "Pomôžte nám zostať neobmedzení";

    // Hladanie prvkov na stránke obsahujúce zadaný text
    const elementsContainingText = Array.from(document.querySelectorAll('*')).filter(element => element.textContent.includes(searchText));

    if (elementsContainingText.length > 0) {
      //  console.log(`ID prvkov obsahujúcich text "${searchText}":`);
        elementsContainingText.forEach(element => {
            if (element.id) {
         //       console.log(`- ID: ${element.id}`)
                element.remove();;
            }
        });
    }
})();