[kp] fix

Remove annoying ads and other crap from KupujemProdajem.com (kupujem prodajem, kupujemprodajem, kp)

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.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

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           [kp] fix
// @description    Remove annoying ads and other crap from KupujemProdajem.com (kupujem prodajem, kupujemprodajem, kp)
// @author         Nemanja Cosovic
// @match          *://*.kupujemprodajem.com/*
// @namespace      https://greasyfork.org/users/380247
// @version        1.3
// ==/UserScript==
window.addEventListener('load', function() {
	var maxRetry = 10;
	var kpSpamSelect = [
		"#bodyTag > div[style*='bottom: 0']",
		".bnrBox31",
        ".fc-consent-root"
	]
    var bodyTag = window.document.querySelector('#bodyTag');

    function removeSpam() {
    	for (var i = kpSpamSelect.length - 1; i >= 0; i--) {
			var kpSpamLock = document.querySelector(kpSpamSelect[i]);

			if (kpSpamLock) {
				kpSpamLock.parentNode.removeChild(kpSpamLock);
			}

            if (bodyTag.getAttribute("style") === "overflow: hidden;") {
                bodyTag.setAttribute("style", "overflow: initial;");
            }
		}
	}

	setTimeout( function() {
		for (maxRetry; maxRetry > 0; maxRetry--) {
			removeSpam();
		}
	}, 100);
}, false);