Not even the people from Easylist seem to fight this site anymore, someone had to try as this looks popular enough. *sigh*
当前为
// ==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/*
// @version 1
// @grant none
// @run-at document-end
// ==/UserScript==
/* run this just on the parent page, not in sub-frames */
if (window.parent !== window)
throw "stop execution";
/* get rid of timeouts right away, they aren't used for anything useful */
console.log("Started KissAnime Anti-Adblock Blocker, waiting for the DOM to load...");
window.setTimeout=undefined;
function when_external_loaded()
{
console.log("DOM loaded, processing stuff...");
window.setTimeout=undefined;
/* remove the anti-adblock script */
if(thing=document.querySelector("#adCheck3 + script"))
{
thing.parentElement.removeChild(thing);
}
/* get rid of the cruft */
for(elem in script=document.querySelectorAll("iframe[src*='ad'], .divCloseBut, .clear2, div[style*='!important']"))
{
if(typeof script[elem]==="object") //&&
//script[elem].innerHTML.match(/AdBlock|isBlockAds2|isBlock3|GotBanned|CheckAdImage/))
{
console.log("removing anti-ablock thingie: ", script[elem]);
script[elem].parentElement.removeChild(script[elem]);
}
}
}
/* inject this cleaning function right in the page */
window.document.head.appendChild(
inject_fn = document.createElement("script")
);
inject_fn.innerHTML = when_external_loaded.toString() + ";when_external_loaded()";
/* fix upper links positioning after removing the cruft */
window.document.head.appendChild(
inject_st = document.createElement("style")
);
inject_st.innerHTML = "a#qualityChoose{display:block;}";
/*
console.log(document.body.innerHTML.match(/AdBlock/));
for(elem in script=document.getElementsByTagName("script"))
{
if(typeof script[elem]==="object") //&&
//script[elem].innerHTML.match(/AdBlock|isBlockAds2|isBlock3|GotBanned|CheckAdImage/))
{
console.log("removing anti-ablock thingie: ", script[elem].innerHTML);
script[elem].parentElement.removeChild(script[elem]);
}
}
*/