二次壁 Anti Adblcok Bypass

繞過二次壁的擋廣告檢查程式 + 去除側邊廣告

当前为 2015-11-10 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        二次壁 Anti Adblcok Bypass
// @namespace   tw.nya.2cat_anti_adblock_killer
// @description 繞過二次壁的擋廣告檢查程式 + 去除側邊廣告
// @include     http://*.2nyan.org/*
// @include     http://2nyan.org/*
// @run-at document-start
// @version     2
// @grant       none
// ==/UserScript==
window.google_ad_block = 1;

if( navigator.userAgent.toLowerCase().indexOf('firefox') > -1 ){ // Firefox supports beforescriptexecute
  window.addEventListener('beforescriptexecute', function _kill_script(e) {
    if(e.target.src.indexOf("load_counter.php") != -1){
      e.preventDefault();
      e.stopPropagation();
      window.removeEventListener("beforescriptexecute", _kill_script, false);
    }
  });
}else{ // fuck chrome
  document.documentElement.addEventListener.addEventListener('load', function _kill_script_slow(e) {
    if(e.target.src.indexOf("load_counter.php") != -1){
      e.preventDefault();
      e.stopPropagation();
      document.documentElement.removeEventListener("load", _kill_script_slow, true);
    }
  }, true);
}

// Kill the Ad on load if we can't stop it at the first place (e.g. Chrome)
window.addEventListener("load", function load(event){
  window.removeEventListener("load", load, false);
  $("#counter, #counter2").remove();
});