TuttoSport.com: Hide Annoying popups (the anti-adblock popup and others)

This script hides the annoying popups (the anti-adblock popup and others) that are shown in the web page.

От 10.05.2025. Виж последната версия.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name           TuttoSport.com: Hide Annoying popups (the anti-adblock popup and others)
// @name:it        TuttoSport.com: Nasconde i popup fastidiosi (il popup anti-adblock ed altri)
// @description    This script hides the annoying popups (the anti-adblock popup and others) that are shown in the web page.
// @description:it Questo script nasconde i popup fastidiosi (il popup anti-adblock e altri) che vengono visualizzati nella pagina web.
// @match          https://*.tuttosport.com/*
// @grant          none
// @require        https://update.greatest.deepsurf.us/scripts/535551/1586435/HideAnnoyingPopupsLib.js
// @version        1.0.6
// @author         Cyrano68
// @license        MIT
// @namespace      https://greatest.deepsurf.us/users/788550
// ==/UserScript==

(function()
{
    "use strict";

    const myVersion = GM_info.script.version;
    consoleLog(`==> TuttoSport_com_HideAnnoyingPopups: HELLO! Loading script (version: ${myVersion})...`);

    function getZeroFilledMillisecs(dateNow)
    {
        const millisecs = dateNow.getMilliseconds();
        return ("00" + millisecs).slice(-3);
    }

    function consoleLog(text)
    {
        const dateNow = new Date();
        //const now = dateNow.toISOString();
        const now = dateNow.toLocaleString() + "." + getZeroFilledMillisecs(dateNow);
        console.log(`${now} ${text}`);
    }

    //document.addEventListener("DOMContentLoaded", onDOMContentLoaded);
    //window.addEventListener("load", onWindowLoaded);

    consoleLog(`==> TuttoSport_com_HideAnnoyingPopups: Using library 'HideAnnoyingPopupsLib' (version: ${window.HideAnnoyingPopupsLib.getVersion()})`);

    const mutationObserverConfig  = {subtree: true, childList: true, attributes: true, attributeOldValue: true, attributeFilter: ["style"]};
    const mutatedNodesConfig      = {selectors: ["div.fc-dialog-container", "div#didomi-host", "div#videoFloat"]/*, onMutatedNode: onMutatedNode*/};
    const mutatedAttributesConfig = {attributeInfos: [{attributeName: "style", targetTagName: "BODY"}]/*, onMutatedAttribute: onMutatedAttribute*/};

    window.HideAnnoyingPopupsLib.configure(mutationObserverConfig, mutatedNodesConfig, mutatedAttributesConfig);

    consoleLog("==> TuttoSport_com_HideAnnoyingPopups: Script loaded");
})();