Smart Adblock Layer Remover

Safely removes only adblock overlays without breaking the page

// ==UserScript==
// @name         Smart Adblock Layer Remover
// @namespace    elite.adblock.surgical
// @version      2.1
// @description  Safely removes only adblock overlays without breaking the page
// @author       Abdelali
// @match        *://*/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function () {
    'use strict';

    const keywords = [
        'disable adblock', 'turn off adblock', 'please disable',
        'bypass extension', 'stop using adblock', 'adblocker detected'
    ];

    const observer = new MutationObserver(() => {
        document.querySelectorAll('div, section, article').forEach(el => {
            const txt = el.innerText?.toLowerCase() || '';
            const styles = getComputedStyle(el);

            const isOverlay = (
                styles.position === 'fixed' &&
                (styles.zIndex > 1000 || styles.zIndex === '9999') &&
                styles.display !== 'none' &&
                styles.visibility !== 'hidden'
            );

            const hasAdblockText = keywords.some(k => txt.includes(k));

            if (isOverlay && hasAdblockText) {
                el.remove();
                console.log('✅ Removed Adblock Overlay:', el);
            }
        });

        // Re-enable scroll and visibility
        document.body.style.overflow = 'auto';
        document.documentElement.style.overflow = 'auto';
        document.body.style.filter = 'none';
        document.body.style.pointerEvents = 'auto';
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

    window.addEventListener('load', () => {
        document.body.style.overflow = 'auto';
        document.body.style.pointerEvents = 'auto';
    });
})();