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*

  1. // ==UserScript==
  2. // @name KissAnime Anti-Adblock Blocker
  3. // @author Swyter
  4. // @contributor 7 Deadly
  5. // @contributor BoLaMN
  6. // @contributor shinji257
  7. // @contributor Thorou
  8. // @namespace userscripts.org/user/swyter
  9. // @description Not even the people from Easylist seem to fight this site anymore, someone had to try as this looks popular enough. *sigh*
  10. // @match *://kissanime.com/*
  11. // @match *://kisscartoon.me/*
  12. // @match *://kissanime.to/*
  13. // @match *://kissasian.com/*
  14. // @match *://kissmanga.com/*
  15. // @match *://readcomiconline.to/*
  16. // @match *://kissanime.ru/*
  17. // @match *://kisscartoon.se/*
  18. // @match *://kissasian.ch/*
  19. // @match *://kimcartoon.me/*
  20. // @match *://kissasian.sh/*
  21. // @match *://kimcartoon.to/*
  22. // @match *://kisstvshow.to/*
  23. // @match *://kimcartoon.li/*
  24. // @version 2022.10.23
  25. // @grant none
  26. // @run-at document-start
  27. // ==/UserScript==
  28.  
  29. console.log('Started KissAnime Anti-Adblock Blocker, waiting for the DOM to load...');
  30.  
  31. window.addEventListener('beforescriptexecute', function(e)
  32. {
  33. /* typical js kludge, holy carp, that's convoluted! */
  34. var element_host = ((tmp = document.createElement('a')).href = e.target.src) && tmp.host;
  35.  
  36. /* fix for KissGrabber; don't block jquery */
  37. if (element_host === 'code.jquery.com')
  38. return;
  39.  
  40. /* fix GP/GUC hosted videos */
  41. if (element_host === 'vjs.zencdn.net')
  42. return;
  43.  
  44. /* gnblizz reported a missing captcha, bail out there */
  45. if (element_host === 'www.sweetcaptcha.com' || element_host === 'apis.google.com')
  46. return;
  47.  
  48. if (e.target.src && element_host !== document.domain &&
  49. element_host !== document.domain.split('.')[0] + '.disqus.com') e.preventDefault();
  50.  
  51. if (!e.target.src)
  52. for (var i of ['charCodeAt', 'window.BB_', 'taboola', 'plusone', 'analytics', 'AdBlock', 'TemporaryBlock'])
  53. if (e.target.textContent.indexOf(i) != -1)
  54. e.preventDefault();
  55.  
  56. console.log('[i] blocking script element: ', e.defaultPrevented, e.target.src);
  57. });
  58.  
  59. window.addEventListener('DOMContentLoaded', function(e)
  60. {
  61. console.log('DOM loaded, processing stuff...');
  62.  
  63. /* get rid of the cruft */
  64. for (var elem of document.querySelectorAll(`
  65. iframe[src*='ad']:not([src*='openload']):not([src*='fbsbx']):not([src*='mp4upload']),
  66. .divCloseBut,
  67. .clear2,
  68. div[style*='!important'],
  69. iframe[style*='!important'][src^='/'],
  70. div[id^='divFloat'],
  71. .episodeList div[style$='float: left;'],
  72. .episodeList .clear,
  73. div[style$='height:80px'],
  74. img[id^='adCheck'],
  75. div[id^=adsFloat][style],
  76. div[id^=btnClose],
  77. div[style*='width:800px'],
  78. div[id*=fl-ads].rf-container,
  79. div[id^=adsIfrme]:not([id=adsIfrme]),
  80. iframe[src*='Ads'],
  81. iframe[src*='facebook'],
  82. iframe[src*='mgi'][height='215'],
  83. div[style*='300px'][style*='250px'],
  84. div[style*='margin: 0px auto'],
  85. div[style*='height: 600px'],
  86. div[style*='820px'][style*='215px'],
  87. div[style*='728px'][style*='200px'],
  88. iframe[width='728px'][height='90px'],
  89. li#liFlappy, li#liReportError,
  90. body > script[src],
  91. script[data-cfasync],
  92. div[style*='728px'][style*='90px'],
  93. div[id^='glx-'],
  94. div[id=videoAd],
  95. div[class^=kcAds],
  96. .adsbyvli,
  97. .adbWarnContainer
  98. `))
  99. {
  100. console.log('[-] removing cruft: ', elem);
  101. elem.parentElement.removeChild(elem);
  102. }
  103.  
  104. /* show the comic pages and comment buttons; they are hidden (display: none) by default */
  105. (img = document.querySelector("div#divImage[style]")) && (img.style.display = "block");
  106. (com = document.querySelector("a#btnShowComments.specialButton[style]")) && (com.style.display = "inline-block");
  107.  
  108. /* let's hook the AJAX requests, just in case, and filter out the so-called 'ban'
  109. avoiding potential fake points loss and such, what a scummy move by the site owner */
  110. (function (xhr_proto_open)
  111. {
  112. window.XMLHttpRequest.prototype.open = function(method, url)
  113. {
  114. if (url.match(/ban|Banned|GotBanned|TemporaryBlock|AGBXSKCSYWBSDAPOLA/gi) !== null)
  115. {
  116. console.info("[x] intercepted shitty 'ban' request!", arguments); this.abort();
  117. }
  118. else
  119. {
  120. xhr_proto_open.apply(this, arguments);
  121. }
  122. };
  123. }(XMLHttpRequest.prototype.open));
  124.  
  125. /* override the check in Chrome and call it a day */
  126. for (var i of ['DoDetect2', 'YANMKABFYWRW', 'HAYNQMAKDASAS', 'YANABWEKA', 'YASBATMBCL'])
  127. try
  128. {
  129. Object.defineProperty(window, i,
  130. {
  131. configurable: false,
  132. writable: false,
  133. value: function()
  134. {
  135. console.info(`[/] ${i} check overriden!`);
  136. }
  137. });
  138. } catch(e) {}
  139. });