eBlock Adblocker Stealth

eBlock Stealth works like eBlock, but is smaller and still works.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Advertisement:

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Advertisement:

// ==UserScript==
// @name         eBlock Adblocker Stealth
// @license      MIT
// @namespace    http://tampermonkey.net/
// @version      2.1
// @description  eBlock Stealth works like eBlock, but is smaller and still works.
// @author       EGem
// @match        *
// @icon         https://creator-cdn.icons8.com/m6a6uDV7S_WZg1Loq2TrQpmFES36N2bsYprPmO6RM1A/rs:fit:200:200/czM6Ly9yMi1pY29u/czgtY3JlYXRvci1w/cm9kL2Fzc2V0cy9l/ZGl0b3IvdXBsb2Fk/cy81NTcvNzM4NDI0/ZTYtMzcwYy00ZmRm/LWFiMzktNjM1M2Nk/NWMxZjg3LnN2Zw.png
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    const css = `
        .ads, .ad-container, .ad-banner, .video-ad,
        iframe[src*="googlesyndication.com"],
        div[id^="google_ads_iframe"],
        div[id^="ad-div"] {
            display: none !important;
        }
    `;
    const style = document.createElement('style');
    style.innerHTML = css;
    document.head.appendChild(style);

    const blockMethods = ['BlockAdBlock', 'adblock', 'adsbygoogle'];
    blockMethods.forEach(method => {
        window[method] = {
            _class: function() { return this; },
            emit: function() { return this; },
            check: function() { return false; },
            on: function() { return this; },
            onDetected: function() { return this; }
        };
    });

    const originalDefine = Object.getOwnPropertyDescriptor(window, 'undefined');
    Object.defineProperty(window, 'adblock', {
        get: () => false,
        configurable: true
    });

    const interceptConsole = () => {
        const _warn = console.warn;
        console.warn = function(...args) {
            if (args[0] && typeof args[0] === 'string' && args[0].includes('adblock')) return;
            _warn.apply(this, args);
        };
    };
    interceptConsole();
})();