Greasy Fork is available in English.

Usuwanie reklam Allegro

Usuwa wszystkie reklamy na Allegro.pl, które nie są blokowane przez zwykłe blokery reklam, np. "Sponsorowane produkty" i "sponsorowane" boksy.

Zainstaluj skrypt?
Skrypt zaproponowany przez autora

Może Ci się również spodobać. Przywrócenie logo Allegro

Zainstaluj skrypt
// ==UserScript==
// @name			Usuwanie reklam Allegro
// @name:en			Remove Allegro ads
// @namespace		http://tampermonkey.net/
// @version			0.5.2.3
// @description		Usuwa wszystkie reklamy na Allegro.pl, które nie są blokowane przez zwykłe blokery reklam, np. "Sponsorowane produkty" i "sponsorowane" boksy.
// @description:en	Aims to remove all ads on Allegro.pl not blocked by regular ad blockers, like "Sponsorowane produkty" and "sponsorowane" ad boxes.
// @author			adamaru
// @match			*://allegro.pl/*
// @icon			https://www.google.com/s2/favicons?sz=64&domain=allegro.pl
// @grant			none
// @license			MIT
// ==/UserScript==

(function() {
    'use strict';
    var running = false;

    function removeAllegroAds(mutations){
        if(mutations){
            var ignoreMutation = false;
            // skip removing ads when changes were made only to countdowns
            mutations.forEach(function(mutation) {
                var i, node;

                for (i = 0; i < mutation.addedNodes.length; i++) {
                    node = mutation.addedNodes[i];
                    if(!node.className || !node.className.indexOf || node.className.indexOf('countdown') !== -1){
                        ignoreMutation = true;
                        return;
                    }
                }

                for (i = 0; i < mutation.removedNodes.length; i++) {
                    node = mutation.removedNodes[i];
                    if(!node.className || !node.className.indexOf || node.className.indexOf('countdown') !== -1){
                        ignoreMutation = true;
                        return;
                    }
                }
            });
            if(ignoreMutation){
                // only countdown changes, skip
                return;
            }
        }

        if(running){
            // already running, skip
            return;
        }
        running = true;

		removeAllegroPremiumAds();
        removeAllegroOfferAds();
        removeAllegroSponsoredAds();
		removeAllegroAdArticles();

        running = false;
    }

    function removeAllegroOfferAds(){
        var adsBoxes = document.querySelectorAll('div[data-box-name*="_ads"]');
        for(var i = 0; i < adsBoxes.length; ++i){
            if(adsBoxes[i].style.display === "none"){
                continue;
            }
            adsBoxes[i].style.display = "none";
        }
    }

    function removeAllegroSponsoredAds(){
        var spansToCheck = document.querySelectorAll('section[class^="_"] > div[class]');
        for(var i = 0; i < spansToCheck.length; ++i){
            if(spansToCheck[i].innerHTML.indexOf('sponsorowane') !== -1){
				if(spansToCheck[i].parentNode.style.display === "none"){
					continue;
				}
                spansToCheck[i].parentNode.style.display = "none";
            }
        }
    }

    function removeAllegroAdArticles(){
        var adArticles = document.querySelectorAll('article[data-analytics-view-label="showSponsoredItems"]');
        for(var i = 0; i < adArticles.length; ++i){
			if(adArticles[i].style.display === "none"){
				continue;
			}
            adArticles[i].style.display = "none";
        }
    }

	function removeAllegroPremiumAds(){
		var premiumAds = document.querySelectorAll('div[data-box-name="premium.with.dfp"],div[data-box-name="layout.advertisement"]');
        for(var i = 0; i < premiumAds.length; ++i){
			if(premiumAds[i].style.display === "none"){
				continue;
			}
            premiumAds[i].style.display = "none";
        }
	}

    removeAllegroAds(null);

    var observer = new MutationObserver(removeAllegroAds);
    var config = {childList: true, subtree: true};
    observer.observe(document.body, config);
})();