Limax AdBlocker

F ADS

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==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);
})();