Anti-AdBlockers Fuckoff

Remove Anti-AdBlockers

目前为 2020-03-05 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Anti-AdBlockers Fuckoff
  3. // @version 1.2
  4. // @description Remove Anti-AdBlockers
  5. // @author Elwyn
  6. // @license MIT
  7. // @homepage https://openuserjs.org/scripts/Elwyn/Anti-AdBlockers_Fuckoff
  8. // @supportURL https://openuserjs.org/scripts/Elwyn/Anti-AdBlockers_Fuckoff/issues
  9. // @namespace https://openuserjs.org/install/Elwyn/Anti-AdBlockers_Fuckoff.user.js
  10. // @iconURL https://gf.qytechs.cn/system/screenshots/screenshots/000/019/394/thumb/icon.png
  11. // @include *
  12. // @noframes
  13. // @run-at document-start
  14. // @grant unsafeWindow
  15. // ==/UserScript==
  16. (function() {
  17.  
  18. var enable_debug = true;
  19.  
  20. // Skip iframes
  21. if ( window.location !== window.parent.location ) return;
  22.  
  23. // Exclude domains
  24. var excludes = ['360.cn', 'adblockplus.org', 'agar.io', 'aliexpress.com', 'amazon.', 'apple.com', 'ask.com', 'baidu.com', 'bing.com', 'bufferapp.com', 'calm.com', 'chatango.com', 'chromeactions.com', 'dolldivine.com', 'easyinplay.net', 'ebay.com', 'exacttarget.com', 'facebook.com', 'flattr.com', 'flickr.com', 'fsf.org', 'gf.qytechs.cn', 'ghacks.net', 'google.', 'imdb.com', 'imgbox.com', 'imgur.com', 'instagram.com', 'jsbin.com', 'jsfiddle.net', 'linkedin.com', 'live.com', 'mail.ru', 'microsoft.com', 'msn.com', 'openuserjs.org', 'pandoon.info', 'paypal.com', 'pinterest.com', 'plnkr.co', 'popmech.ru', 'preloaders.net', 'qq.com', 'reddit.com', 'stackoverflow.com', 'tampermonkey.net', 'twitter.com', 'vimeo.com', 'wikipedia.org', 'w3schools.com', 'xemvtv.net', 'yahoo.', 'yandex.ru', 'youtu.be', 'youtube.com', 'vod.pl'];
  25. if ( new RegExp( excludes.join('|').replace(/\./g,'\.') ).test( location.host ) ) return;
  26.  
  27. // AdBlock Pattern to Search
  28. var adblock_pattern = /ad-block|adblock|ad block|bloqueur|bloqueador|Werbeblocker|آدبلوك بلس|блокировщиком/i;
  29. var disable_pattern = /kapat|disabl|désactiv|desactiv|desativ|deaktiv|detect|enabled|turned off|turn off|απενεργοποίηση|запрещать|állítsd le|publicités|рекламе|verhindert|advert|kapatınız/i;
  30.  
  31. var is_core_protected = false;
  32. var is_anti_adblock = false;
  33. var protect_body = false;
  34.  
  35. // HELPER Functions
  36. //-----------------
  37. function debug( value ) {
  38. if ( !enable_debug ) return;
  39. if ( typeof value == 'string' ) {
  40. console.log( "ANTI-ADBLOCKER: " + value );
  41. } else {
  42. console.log( "ANTI-ADBLOCKER: -> ");
  43. console.log( value );
  44. }
  45. }
  46.  
  47. function addStyle(str) {
  48. var node = document.createElement('style');
  49. node.innerHTML = str;
  50. document.body.appendChild(node);
  51. }
  52.  
  53. function randomInt( min, max )
  54. {
  55. // min and max included
  56. if ( max === undefined ) {
  57. max = min;
  58. min = 0;
  59. }
  60. return Math.floor(min + Math.random() * (max - min + 1));
  61. }
  62.  
  63. function getRandomName( size )
  64. {
  65. var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  66. var i;
  67. var name = '';
  68. for (i = 0; i < (size||randomInt(10,20)); i++)
  69. {
  70. name += chars.charAt( randomInt(0,chars.length) );
  71. }
  72. return name;
  73. }
  74.  
  75. function includeElement( el ) {
  76. var name = getRandomName();
  77. if ( el.className.length == 0 ) {
  78. el.className = name;
  79. } else {
  80. el.className += ' ' + name;
  81. }
  82. return '.' + name + ',';
  83. }
  84.  
  85. function protectCore() {
  86. if ( is_core_protected ) return;
  87. is_core_protected = true;
  88. // Protect RemoveChild
  89. // Blocks the possibility of being able to remove the BODY or the HEAD
  90. let $_removeChild = unsafeWindow.Node.prototype.removeChild;
  91. unsafeWindow.Node.prototype.removeChild = function( node ) {
  92. if ( node.tagName == 'HEAD' || node.tagName == 'BODY' ) return;
  93. if ( protect_body && node.parentNode.tagName == 'BODY' ) return;
  94. $_removeChild.apply( this, arguments );
  95. };
  96. let $_innerHTML = unsafeWindow.Node.prototype.innerHTML;
  97. unsafeWindow.Node.prototype.innerHTML = function( node ) {
  98. if ( node.tagName == 'HEAD' || node.tagName == 'BODY' ) return;
  99. $_innerHTML.apply( this, arguments );
  100. };
  101.  
  102. // Protect innerHTML
  103. let $_innerHTML_set = Object.getOwnPropertyDescriptor(Element.prototype, 'innerHTML').set;
  104.  
  105. Object.defineProperty(Element.prototype, 'innerHTML', {
  106. set: function (value) {
  107. if ( this.tagName == 'HEAD' || this.tagName == 'BODY' ) return;
  108. //Call the original setter
  109. return $_innerHTML_set.call(this, value);
  110. }
  111. });
  112. }
  113.  
  114. // Main Functions
  115. function removeBlackout( el )
  116. {
  117. var classes = '';
  118. document.querySelectorAll( 'a,b,center,div,h1,h2,h3,h4,h5,h6,i,font,s,span,strong,p,q,u' ).forEach( ( el ) => {
  119. let style = window.getComputedStyle( el );
  120. let height, width;
  121. if ( style.getPropertyValue( 'position' ) == 'fixed' )
  122. {
  123. height = style.getPropertyValue( 'height' );
  124. width = style.getPropertyValue( 'width' );
  125. if ( ( height == '100%' && width == '100%' ) || ( parseInt( height ) > window.innerHeight - 100 && parseInt( width ) > window.innerWidth - 100 ) )
  126. {
  127. classes += includeElement( el );
  128. }
  129. }
  130. });
  131.  
  132. if ( classes.length > 0 ) {
  133.  
  134. classes = classes.substring( 0, classes.length - 1 );
  135.  
  136. debug( 'Blackout classes:' + classes );
  137.  
  138. // Hide Anti-AdBlocker Blackout Elements
  139. addStyle( classes + '{ display: none !important; }' );
  140.  
  141. // Remove Blur FX of Elements
  142. addStyle( '* { -webkit-filter: blur(0px) !important; filter: blur(0px) !important; }' );
  143. }
  144. }
  145.  
  146. function removeModal( el )
  147. {
  148. debug( 'AntiAdBlocker Found!');
  149.  
  150. var classes = '';
  151.  
  152. // Holder of the Modal message
  153. for (;;) {
  154. classes += includeElement( el );
  155. if ( el.parentNode.tagName == 'BODY' || el.parentNode.tagName == 'HEAD' ) break;
  156. el = el.parentNode;
  157. }
  158.  
  159. if ( classes.length > 0 ) {
  160.  
  161. classes = classes.substring( 0, classes.length - 1 );
  162.  
  163. debug( 'Modal classes:' + classes );
  164.  
  165. // Hide Anti-AdBlocker Modal Elements
  166. addStyle( classes + '{ display: none !important; }' );
  167.  
  168. // Blackout Elements
  169. removeBlackout();
  170.  
  171. // Blocks the possibility of being able to remove the BODY or the HEAD
  172. protectCore();
  173. }
  174.  
  175. }
  176.  
  177.  
  178.  
  179. document.addEventListener('DOMContentLoaded', function() {
  180.  
  181. // Mutation Observer
  182. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
  183.  
  184. // Create an observer instance
  185. var observer = new MutationObserver( (mutations) => {
  186. mutations.forEach( (mutation) => {
  187. if ( mutation.addedNodes.length ) {
  188. Array.prototype.forEach.call( mutation.addedNodes, (addedNode) => {
  189. // skip nodes with undefined text
  190. if ( typeof addedNode.innerText == 'undefined' ) return;
  191. // skip nodes without text
  192. if ( addedNode.innerText.length < 1 ) return;
  193. // search texts that ask to deactivate the AdBlock
  194. // debug( addedNode.innerText );
  195. if ( adblock_pattern.test( addedNode.innerText ) && disable_pattern.test( addedNode.innerText ) )
  196. {
  197. removeModal( addedNode );
  198. }
  199. });
  200. }
  201. });
  202. });
  203. // Observer
  204. observer.observe(document, {
  205. childList : true,
  206. subtree : true
  207. });
  208.  
  209. let body_style = window.getComputedStyle( document.body );
  210. document.body.style.visibility = 'hidden';
  211. if ( body_style.getPropertyValue( 'visibility' ) == 'visible' )
  212. {
  213. protect_body = true;
  214. protectCore();
  215. }
  216. document.body.style.visibility = 'visible';
  217.  
  218. },false);
  219.  
  220.  
  221. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址