Greasy Fork

Greasy Fork is available in English.

Assassinate Ad Block Blockers [BETA]

You know those annoying content blockers that popup demanding you remove your AdBlock so you can read the content? This script removes them by force. Please note, this is not UNIVERSAL like AdBlock Plus. It operates at a per-site basis.

当前为 2019-05-02 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Assassinate Ad Block Blockers [BETA]
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  You know those annoying content blockers that popup demanding you remove your AdBlock so you can read the content? This script removes them by force. Please note, this is not UNIVERSAL like AdBlock Plus. It operates at a per-site basis.
// @author       Kxmode
// @run-at       document-idle
// @match        *://www.vg247.com/*
// @match        *://www.eurogamer.net/*
// @match        *://www.makeuseof.com/*
// @match        *://www.gamesradar.com/*
// @match        *://www.usatoday.com/*
// @match        *://www.cnn.com/*
// ==/UserScript==

// Loads jQuery and triggers a callback function when jQuery has finished loading
function addJQuery(callback) {
    var script = document.createElement("script");
    script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js");
    script.addEventListener('load', function() { callback(); }, false);
    document.body.appendChild(script);
}

// The main script
function main() {

    const $ = (unsafeWindow || window).$;

    // For domains that follow the standard way of blocking AdBlockers typically with a full-page block and overlay.
    var arrayStandardBlockerDomains = [ "www.vg247.com",
                                        "www.eurogamer.net",
                                        "www.gamesradar.com",
                                        "www.usatoday.com",
                                        "www.cnn.com"].map(String);

    // For domains that follow a nonstandard way of blocking AdBlockers by typically blocking the content area only.
    var arrayAbnormalBlockerDomains = [ "www.makeuseof.com"].map(String);

    // For domains that typically launch third-party modals for random stuff like sign-ups.
    var arrayAuxiliaryBlockerDomains = [ "www.gamesradar.com"].map(String);

    function DOMStatusCheck() {
        if (arrayStandardBlockerDomains.indexOf(window.location.hostname) > -1)
        {
            var isHTMLBlocked = $("html").attr("style");
            var isBodyBlocked = $("body").attr("style");
            if (isHTMLBlocked !== undefined || isBodyBlocked !== undefined)
            {
                clearInterval(currentStatus1);
                // We're on a page that is blocked

                $("html").removeAttr("style");
                $("body").removeAttr("style");

                switch(window.location.hostname)
                {
                    case arrayStandardBlockerDomains[0]:    // vg247
                    case arrayStandardBlockerDomains[1]:    // eurogamer
                    case arrayStandardBlockerDomains[2]:    // gamesradar
                    case arrayStandardBlockerDomains[3]:    // usatoday
                    case arrayStandardBlockerDomains[4]:    // cnn
                        $("[class*='sp_veil']").remove();
                        $("[id*='sp_message_id']").remove();
                        break;
                }
            }

            console.clear();
        }

        if (arrayAuxiliaryBlockerDomains.indexOf(window.location.hostname) > -1)
        {
            switch(window.location.hostname)
            {
                case arrayAuxiliaryBlockerDomains[0]:    // gamesradar
                    if ($(".raleigh-optin-visible").is(":visible"))
                    {
                        clearInterval(currentStatus2);
                        $("[class*='raleigh-optin-']").remove();
                    }
                    break;
            }
        }

    }

    if (arrayAbnormalBlockerDomains.indexOf(window.location.hostname) > -1)
    {
        switch(window.location.hostname)
        {
            case arrayAbnormalBlockerDomains[0]:    // makeuseof
                $("[class*='unblockplease-overlay']").remove();
                $(".unblockplease").removeAttr("style");
                break;
        }

    }

    function ClearAllIntervals()
    {
        for (var i = 1; i < 5; i++)
        {
            var intervalName = "currentStatus" + i;
            clearInterval(intervalName);
        }
        clearInterval(ci);
        console.clear();
        console.log("all intervals cleared");
    }

    // Sets up listeners to supercede any blocker shenanigans
    if (arrayStandardBlockerDomains.indexOf(window.location.hostname) > -1) { var currentStatus1 = setInterval(DOMStatusCheck, 50); }
    if (arrayAuxiliaryBlockerDomains.indexOf(window.location.hostname) > -1) { var currentStatus2 = setInterval(DOMStatusCheck, 50); }

    // Second-system pass after 1.5 seconds
    if (arrayStandardBlockerDomains.indexOf(window.location.hostname) > -1) { var currentStatus3 = setTimeout(DOMStatusCheck, 1500); }

    // third-system pass after 2.5 seconds
    if (arrayStandardBlockerDomains.indexOf(window.location.hostname) > -1) { var currentStatus4 = setTimeout(DOMStatusCheck, 2500); }

    // Last-pass guarantee after 7 seconds
    var ci = setTimeout(ClearAllIntervals, 7000);

    console.clear();
}

// Load jQuery and then execute the main function
addJQuery(main);