Greasy Fork

Greasy Fork is available in English.

KissAnime Anti-Adblock Blocker

Not even the people from Easylist seem to fight this site anymore, someone had to try as this looks popular enough. *sigh*

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        KissAnime Anti-Adblock Blocker
// @namespace   userscripts.org/user/swyter
// @description Not even the people from Easylist seem to fight this site anymore, someone had to try as this looks popular enough. *sigh*
// @match       http://kissanime.com/*
// @match       http://kisscartoon.me/*
// @match       http://kissanime.to/*
// @version     2015.11.07
// @grant       none
// @run-at      document-end
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=swyterzone%40gmail%2ecom&item_number=swydonations&currency_code=EUR
// ==/UserScript==

/* run this just on the parent page, not in sub-frames */
if (window.parent !== window)
  throw "stop execution";

console.log("Started KissAnime Anti-Adblock Blocker, waiting for the DOM to load...");

function when_external_loaded()
{
  console.log("DOM loaded, processing stuff...");

  /* override the check in Chrome and call it a day */
  Object.defineProperty(window, 'DoDetect2',
  {
    configurable: false,
    writable: false,
    value: function()
    {
      console.info("check overriden!");
    }
  });

  /* remove the anti-adblock script */
  if((thing = document.querySelector("#adCheck3 + script")))
  {
    console.log("Getting rid of the script itself...");
    thing.parentElement.removeChild(thing);
  }

  /* get rid of the cruft */
  for(var elem in (cruft = document.querySelectorAll(" iframe[src*='ad'],                         \
                                                      .divCloseBut,                               \
                                                      .clear2,                                    \
                                                       div[style*='!important'],                  \
                                                       div[id^='divFloat'],                       \
                                                      .episodeList div[style$='float: left;'],    \
                                                      .episodeList .clear,                        \
                                                       div[style$='height:80px'],                 \
                                                       img[id^='adCheck'],                        \
                                                       div[id^=adsFloat][style],                  \
                                                       div[id^=btnClose]")))
  {
    if(typeof cruft[elem] === "object")
    {
      console.log("removing cruft: ", cruft[elem]);
      cruft[elem].parentElement.removeChild(cruft[elem]);
    }
  }

  /* let's hook the AJAX requests, just in case, and filter out the so-called 'ban'
     avoiding potential fake points loss and such, what a scummy move by the site owner */
  (function(xhr_proto_open)
  {
    window.XMLHttpRequest.prototype.open = function(method, url)
    {
      if(url.match(/ban|Banned|GotBanned/gi) !== null)
      {
        console.info("Intercepted shitty 'ban' request!", arguments);
        this.abort();
      }
      else
      {
        xhr_proto_open.apply(this, arguments);
      }
    };
  }(XMLHttpRequest.prototype.open));
}

/* inject this cleaning function right in the page to avoid silly sandbox-related greasemonkey limitations */
window.document.head.appendChild(
  inject_fn = document.createElement("script")
);

inject_fn.innerHTML = '(' + when_external_loaded.toString() + ')()';