Shellshock.io Remove adblocker message

Block the adblocker message

当前为 2022-07-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Shellshock.io Remove adblocker message
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Block the adblocker message
  6. // @author mewen25
  7. // @match https://shellshock.io/
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. window.XMLHttpRequest = class extends window.XMLHttpRequest {
  14.  
  15. open( method, url ) {
  16. if ( url.indexOf( 'shellshock.js' ) > - 1 ) {
  17. this.isScript = true;
  18. }
  19. return super.open( ...arguments );
  20. }
  21.  
  22. get response() {
  23. if ( this.isScript ) {
  24. let code = super.response;
  25. const ad = /showAdBlockerVideo\(\),setTimeout\(\(\)=>\{vueApp\.hideAdBlockerVideo\(\),vueApp\.gameUiRemoveClassForNoScroll\(\),yi\(\)\},1e4\)\)\}/.exec(code)[0];
  26.  
  27. console.log( '[INJECTING] - anti anti-adblock');
  28.  
  29. const replaceAd = 'hideAdBlockerVideo(),setTimeout(()=>{yi()},100))}';
  30.  
  31. code = code.replace(ad, replaceAd);
  32. return code;
  33. }
  34. return super.response;
  35. }
  36. };