Shellshock.io Remove Adblocker message

Block the adblocker message

当前为 2022-08-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Shellshock.io Remove Adblocker message
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  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. var open_prototype = XMLHttpRequest.prototype.open, intercept_response = function(callback) {
  14. XMLHttpRequest.prototype.open = function(method, url) {
  15. if(url.indexOf("shellshock.js") > -1) this.isScript = true;
  16. this.addEventListener('readystatechange', function(event) {
  17. if ( this.readyState === 4 && this.isScript ) {
  18. var response = callback(event.target.responseText);
  19. Object.defineProperty(this, 'response', {writable: true});
  20. Object.defineProperty(this, 'responseText', {writable: true});
  21. this.response = this.responseText = response;
  22. }
  23. });
  24. return open_prototype.apply(this, arguments);
  25. };
  26. };
  27.  
  28. intercept_response(function(response) {
  29. const ad = /((showAdBlockerVideo\(\),set).+?(?=l\(\),).{4})([A-z].+?(?=\(\)\})).+?(?=;var)/.exec(response);
  30. const adLine = ad[0];
  31. const adVar = ad[3];
  32. const replaceAd = `hideAdBlockerVideo(),setTimeout(()=>{${adVar}()},100))}`;
  33. console.log("[INJECTING] - Adblock popup block");
  34. return response.replace(adLine, replaceAd);
  35. });
  36.