Limax AdBlocker

F ADS

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Limax AdBlocker
// @namespace   Violentmonkey Scripts
// @match       *://limax.io/*
// @grant       unsafeWindow
// @version     1.0
// @author      Drik
// @description F ADS
// @license     MIT
// ==/UserScript==

(function() {
    'use strict';
    const S = ['#advert', '#vertad', '#crossPromotion'];
    const hide = el => {
        if (!el) return;
        el.style.setProperty('pointer-events', 'none', 'important');
        el.style.setProperty('opacity', '0', 'important');
        el.style.setProperty('visibility', 'hidden', 'important');
        el.style.setProperty('display', 'none', 'important');
    };
    const hideAll = () => S.forEach(sel => document.querySelectorAll(sel).forEach(hide));
    const w = (typeof unsafeWindow !== 'undefined') ? unsafeWindow : window;
    const patch = () => {
        try {
            hideAll();
            if (!w) return;
            w.wait_banner_rendering = 0;
            w.adinplay_counter = 0;
            w.ADINPLAY_LOOP = 1e9;
            if (w.Widget && typeof w.Widget === 'object') {
                w.Widget.preroll = function() {
                    try {
                        w.start();
                    } catch (e) {}
                };
                w.Widget.play = function() {
                    try {
                        w.start();
                    } catch (e) {}
                };
                w.Widget.adsRefresh = function() {};
                w.Widget.refresh = function() {};
                w.Widget.stop = function() {};
            }
            const p = document.getElementById('play');
            if (p) p.onclick = function() {
                try {
                    if (!w.disa_interface && w.wait_banner_rendering === 0) {
                        w.disa_interface = true;
                        w.start && w.start();
                    }
                } catch (e) {}
            };
        } catch (e) {}
    };
    if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', patch);
    else patch();
    setInterval(patch, 777);
})();