Chess Com Hide Upgrade Stuff

Hides Upgrade Div Stuff

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          Chess Com Hide Upgrade Stuff
// @namespace     http://userstyles.org
// @description   Hides Upgrade Div Stuff
// @author        636597
// @include       /chess\.com
// @run-at        document-start
// @version       0.2
// ==/UserScript==

var css_selectors_hide = [
	"a.diamond" ,
	"div.adblock-message" ,
    "div.upgrade-content" ,
    "div.short-sidebar-ad-top" ,
    "div.short-sidebar-ad-bottom" ,
];

function _hide_stuff() {
	try {

		var upgrade_text = document.querySelectorAll( "span.text" );
		for ( var j = 0; j < upgrade_text.length; ++j  ) {
			var x = upgrade_text[ j ].innerHTML;
			x = x.trim();
			x = x.toLowerCase();
			if ( x === "upgrade" ) {
				upgrade_text[ j ].style.visibility = "hidden";
			}
		}

		for ( var i = 0; i < css_selectors_hide.length; ++i ) {
			var elements = document.querySelectorAll( css_selectors_hide[ i ] );
			for ( var j = 0; j < elements.length; ++j  ) {
				elements[ j ].style.visibility = "hidden";
			}
		}

	}
	catch( error ) { console.log( error ); }
}

var hide_interval = null;
function hide_stuff() {
	hide_interval = setInterval( _hide_stuff , 50 );
	setTimeout( function() {
		clearInterval( hide_interval );
	}, 3000 );
}

hide_stuff();
window.addEventListener ( "load" , _hide_stuff );