Greasy Fork 还支持 简体中文。

Universal AdBlock Bypass (Beta)

Attempts to bypass ad-blocker detection on all websites

目前為 2025-04-29 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Universal AdBlock Bypass (Beta)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Attempts to bypass ad-blocker detection on all websites
// @author       Snow2122
// @license      MIT
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Match all websites
    // @match        *://*/*

    // Override common ad-blocker detection variables and functions
    window.ai_adb_active = true;
    window.ai_adb_action = 0;
    window.ai_adb_undetected = function() {
        document.querySelector('body')?.setAttribute('data-data-mask', 'clear');
        if (typeof window.ai_adb_undetected_actions === 'function') {
            window.ai_adb_undetected_actions(0);
        }
    };

    // Simulate successful ad script loading
    const originalFetch = window.fetch;
    window.fetch = function(url, options) {
        if (url.includes('pagead') || url.includes('ads.') || url.includes('doubleclick')) {
            return Promise.resolve(new Response('OK', { status: 200 }));
        }
        return originalFetch.apply(this, arguments);
    };

    // Remove ad-blocker overlays and messages
    function removeAdBlockElements() {
        const overlays = document.querySelectorAll('ins > div, .ad-block-message, #adblock-overlay, .ai-adb-overlay');
        const messages = document.querySelectorAll('section > div, .adblock-notice, .ai-adb-message-window');
        overlays.forEach(el => el.remove());
        messages.forEach(el => el.remove());
    }

    // Clear ad-blocker related cookies
    function clearCookies() {
        const cookies = ['aiADB', 'aiADB_PV', 'aiADB_PR', 'adblock_detected'];
        cookies.forEach(cookie => {
            document.cookie = `${cookie}=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
        });
    }

    // Ensure content visibility
    function restoreContent() {
        document.querySelectorAll('.ai-adb-hide, .adblock-hidden').forEach(el => {
            el.style.display = 'block';
            el.style.visibility = 'visible';
            el.classList.remove('ai-adb-hide', 'adblock-hidden');
        });
        document.querySelectorAll('.ai-adb-show, .adblock-show').forEach(el => {
            el.style.display = 'none';
            el.classList.remove('ai-adb-show', 'adblock-show');
        });
    }

    // Initialize bypass
    function init() {
        clearCookies();
        removeAdBlockElements();
        restoreContent();
        if (typeof window.ai_adb_undetected === 'function') {
            window.ai_adb_undetected(0);
        }
    }

    // Run when DOM is loaded
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', init);
    } else {
        init();
    }

    // Observe for dynamically added elements
    const observer = new MutationObserver((mutations) => {
        mutations.forEach(() => {
            removeAdBlockElements();
            restoreContent();
        });
    });

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