NotDS chess.com ad killer

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
    });

})();