[kp] fix

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

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           [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);