NotDS chess.com ad killer

11/16/2020 - kills chess.com ads, older downloadable scripts are failing to do so it seems.

  1. // ==UserScript==
  2. // @name NotDS chess.com ad killer
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description 11/16/2020 - kills chess.com ads, older downloadable scripts are failing to do so it seems.
  6. // @author NotDS
  7. // @match https://*.chess.com/*
  8. // @match http://*.chess.com/*
  9. // ==/UserScript==
  10.  
  11. var myVar = setInterval(myTimer, 1000);
  12.  
  13. function myFunction() {
  14.  
  15. for(let source of document.body.getElementsByTagName("iframe")){if(source.id.includes("google")){source.hidden = true;}}
  16. for (let dodo of document.body.getElementsByClassName("placeholder-ad-upgrade")){dodo.remove();}
  17. for (let poopoo of document.body.getElementsByClassName("sidebar-ad")){poopoo.remove();}
  18. for (let ish of document.body.getElementsByClassName("main-ad-component")){ish.remove();}
  19. for (let bs of document.body.getElementsByClassName("game-over-ad-component")){bs.remove();}
  20.  
  21. }
  22.  
  23.  
  24. function myTimer() {
  25. for(let source of document.body.getElementsByTagName("iframe")){if(source.id.includes("google")){source.hidden = true;}}
  26. for (let dodo of document.body.getElementsByClassName("placeholder-ad-upgrade")){dodo.remove();}
  27. for (let poopoo of document.body.getElementsByClassName("sidebar-ad")){poopoo.remove();}
  28. for (let ish of document.body.getElementsByClassName("main-ad-component")){ish.remove();}
  29. for (let bs of document.body.getElementsByClassName("game-over-ad-component")){bs.remove();}
  30.  
  31.  
  32. }
  33.  
  34.  
  35. function myStopFunction() {
  36. clearInterval(myVar);
  37. }
  38.  
  39. (function() {
  40. 'use strict';
  41.  
  42. window.addEventListener('load', function() {
  43. console.log('All assets are loaded');
  44. document.body.getElementsByTagName("iframe")[0].addEventListener("change", myFunction);
  45. });
  46.  
  47. })();