Limax AdBlocker

F ADS

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 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);
})();