eBlock Adblocker Stealth

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

Advertisement:

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.

(I already have a user style manager, let me install it!)

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