Removes the 'disable Adblock' nag screen.
当前为
// ==UserScript==
// @name SC2Casts.com Adblock Nag Screen Remover
// @namespace http://lazy.artifact
// @version 0.28
// @description Removes the 'disable Adblock' nag screen.
// @author Lazy Artifact
// @match http://sc2casts.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
/*
try to get some relaxation time in there. you don't *need* to update every day, do you? :)
*/
var popupFuncBodyRegex = new RegExp('\u0069\u0066\u005C\u0028\u0021\u006F\u0066\u0066\u005C\u0029', 'ui'),
i,
noop = function() {},
regexBodyAction = function(i, obj) {
if (popupFuncBodyRegex.test(obj[i].toString())) {
obj[i] = noop;
}
},
walk = function(obj, action, maxDepth) {
var i,
nodes = [
{
value: obj,
parent: null
}
],
nodeType,
parent,
currentDepth;
while(nodes.length > 0) {
obj = nodes.shift();
parent = obj.parent;
currentDepth = 0;
while(parent !== null && parent !== undefined) {
parent = parent.parent;
currentDepth++;
}
if(maxDepth !== undefined && maxDepth !== null && currentDepth >= maxDepth) {
break;
}
for(i in obj.value) {
console.log(i);
if(obj.value[i] === null || obj.value[i] === undefined) {
continue;
}
if(!Object.prototype.hasOwnProperty.call(obj.value, i)) {
continue;
}
nodeType = typeof obj.value[i];
if(nodeType === 'object' && !(obj.value[i] instanceof window.constructor)) {
if(nodes.findIndex(function(e) { return obj.value[i] === e; }) < 0) {
continue;
}
nodes.push({
value: obj.value[i],
parent: obj
});
continue;
}
if(nodeType !== 'function') {
continue;
}
action(i, obj.value);
}
}
};
walk(window, regexBodyAction, null);
})();