shadofx / KissManga Adblock

// ==UserScript==
// @name         KissManga Adblock
// @namespace
// @description  Sometimes KissManga goes out of its way to screw with ad block. Install this and disable your normal adblock to avoid ads
// @copyright    2018, shadofx (
// @license      MIT
// @match*
// @match*
// @match*
// @match*
// @match*
// @match*
// @match*
// @match*
// @match*
// @match*
// @updateURL
// @grant        none
// @version      5.04
// @run-at       document-start
// @require
// ==/UserScript==
// ==OpenUserJS==
// @author       shadofx
// ==/OpenUserJS==
var $ = jQuery;
let oldDocEvLi = EventTarget.prototype.addEventListener;
let oldWOpen =;
function addEventListener(type,lis){
        if(type=='click'&&'m0'){return;},type,lis)//prevent javascript popups (mostly for Edge)
function SwapAEL(){//sabotage addEventListener and
    EventTarget.prototype.addEventListener = addEventListener = wopen
function wopen(URL, name, specs, replace){
        oldWOpen(URL,name,specs,replace)//only open javascript navs to same origin
// If it's the challenge page then wait for it to finish beofore sabotage (sometimes challenge page gets stuck)
if($('head title').text()=="Please wait 5 seconds..."){setInterval(SwapAEL,5000)}else{SwapAEL()}
//RemoveAds removes the offending nodes
function RemoveAds(){
    if($('iframe[src*=recaptcha]').length==0)//don't block when there's google recaptcha
        $("a:contains('Hide')").click();//click on hide button
        $('a[target^="_blank"]>img').remove();//remove any image inside a link which opens in a new tab
        $('div[style*="width: 2048px"][style*="z-index: 2147483647"]').remove();//remove the massive click-interceptor that spans the entire page
        $('div[style*="z-index: 2000"]').remove();//remove the click-interceptor that blocks disqus
        $('iframe').not('#disqus_thread>iframe[src*="comments"]').not('[id^="dsq-app"]:not([src*=""])').not('#ifrmVast').remove();//remove iframes except for the disqus/video ones
        $('iframe[src*="ads-iframe"]').remove();//disqus ads
        $('body>div[style*="absolute"]').remove()//remove click-interceptor that blocks disqus (added 3/29/2019)
        $('#footer').remove()//footer gets in the way for some reason
//repeatedly run RemoveAds while DOM loads
var loadproc = setInterval(RemoveAds, 50);
//When DOM is loaded...
window.addEventListener("DOMContentLoaded", () => {
    //..stop spamming RemoveAds...
    //..because we can add more targeted handlers to spam RemoveAds more efficiently:
    document.addEventListener("readystatechange", RemoveAds);//Run when page is entirely loaded
    new MutationObserver(RemoveAds).observe($('body')[0],{childList: true}); //Run whenever body is changed
    document.addEventListener("visibilitychange", RemoveAds);//Run when you switch tabs
    //$('div#divImage').click(Next);//For unknown reasons click functionality gets compromised on chrome