NotDS chess.com ad killer

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         NotDS chess.com ad killer
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  11/16/2020 - kills chess.com ads, older downloadable scripts are failing to do so it seems.
// @author       NotDS
// @match        https://*.chess.com/*
// @match        http://*.chess.com/*
// ==/UserScript==

 var myVar = setInterval(myTimer, 1000);

function myFunction() {

    for(let source of document.body.getElementsByTagName("iframe")){if(source.id.includes("google")){source.hidden = true;}}
    for (let dodo of document.body.getElementsByClassName("placeholder-ad-upgrade")){dodo.remove();}
    for (let poopoo of document.body.getElementsByClassName("sidebar-ad")){poopoo.remove();}
    for (let ish of document.body.getElementsByClassName("main-ad-component")){ish.remove();}
    for (let bs of document.body.getElementsByClassName("game-over-ad-component")){bs.remove();}

}


function myTimer() {
    for(let source of document.body.getElementsByTagName("iframe")){if(source.id.includes("google")){source.hidden = true;}}
    for (let dodo of document.body.getElementsByClassName("placeholder-ad-upgrade")){dodo.remove();}
    for (let poopoo of document.body.getElementsByClassName("sidebar-ad")){poopoo.remove();}
    for (let ish of document.body.getElementsByClassName("main-ad-component")){ish.remove();}
    for (let bs of document.body.getElementsByClassName("game-over-ad-component")){bs.remove();}


}


function myStopFunction() {
  clearInterval(myVar);
}

(function() {
    'use strict';

    window.addEventListener('load', function() {
    console.log('All assets are loaded');
        document.body.getElementsByTagName("iframe")[0].addEventListener("change", myFunction);
    });

})();