NotDS chess.com ad killer

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

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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);
    });

})();