No Error in DevTools for Ads Block

Remove errors due to global objects not found

  1. // ==UserScript==
  2. // @name No Error in DevTools for Ads Block
  3. // @namespace UserScripts
  4. // @match https://*/*
  5. // @match http://*/*
  6. // @exclude *://google.com/*
  7. // @exclude *://*.google.com/*
  8. // @grant none
  9. // @version 0.1.1
  10. // @author CY Fung
  11. // @license MIT
  12. // @description Remove errors due to global objects not found
  13. // @run-at document-start
  14. // @allFrames true
  15. // @unwrap
  16. // @inject-into page
  17. // ==/UserScript==
  18.  
  19. (()=>{
  20.  
  21. const recurriver = new Proxy(function(){return recurriver}, {
  22. get(target, prop, handler){
  23. if(prop in target) return typeof target[prop]==='function'?target[prop].bind(target): target[prop];
  24. return recurriver;
  25. }
  26. })
  27.  
  28. this.google = recurriver;
  29.  
  30.  
  31. })();
  32.