您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the 'disable Adblock' nag screen.
当前为
- // ==UserScript==
- // @name SC2Casts.com Adblock Nag Screen Remover
- // @namespace http://lazy.artifact
- // @version 0.35
- // @description Removes the 'disable Adblock' nag screen.
- // @author Lazy Artifact
- // @match http://sc2casts.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var popupFuncBodyRegex = /display\s*=\s*["']/im,
- i,
- regexBodyAction = function(i, obj) {
- if (popupFuncBodyRegex.test(obj[i].toString())) {
- var oldFunc = obj[i],
- funcToString = Function.prototype.toString,
- noop = function() {};
- obj[i] = noop;
- noop.toString = function() {
- return funcToString.call(oldFunc);
- };
- }
- },
- 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) {
- 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);
- })();