二次壁 Anti Adblcok Bypass

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

目前为 2015-11-10 提交的版本。查看 最新版本

// ==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();
});