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.
当前为
// ==UserScript==
// @name Assassinate Ad Block Blockers [BETA]
// @namespace http://tampermonkey.net/
// @version 1.5
// @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/*
// @match *://www.businessinsider.com/*
// @match *://www.thedailybeast.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, or some other unique way.
var arrayAbnormalBlockerDomains = [ "www.makeuseof.com",
"www.businessinsider.com",
"www.thedailybeast.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;
case arrayAbnormalBlockerDomains[1]: // businessinsider
case arrayAbnormalBlockerDomains[2]: // dailybeast
$(".tp-modal").remove();
$(".tp-backdrop").remove();
$("body").removeClass("tp-modal-open");
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 pass after 1.5 seconds
if (arrayStandardBlockerDomains.indexOf(window.location.hostname) > -1) { var currentStatus3 = setTimeout(DOMStatusCheck, 1500); }
if (arrayAbnormalBlockerDomains.indexOf(window.location.hostname) > -1) { var currentStatus5 = setTimeout(DOMStatusCheck, 1500); }
// Third 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);