Greasy Fork

Etsy - Remove Promoted Ads

Remove the promoted ads that clutter the search results on Etsy.

目前为 2020-09-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         Etsy - Remove Promoted Ads
// @author       RandomUsername404
// @namespace    https://greasyfork.org/en/users/105361-randomusername404
// @version      1.2
// @description  Remove the promoted ads that clutter the search results on Etsy.
// @run-at       document-start
// @include      https://www.etsy.com/*/search?q=*
// @include      https://www.etsy.com/search?q=*
// @grant        none
// @icon         https://www.etsy.com/images/favicon.ico
// ==/UserScript==

var promoted = ["Annonce de", "Anzeige des", "Ad from", "Anuncio de la tienda", "Annuncio dal negozio", "ショップ", "Advertentie van shop", "Reklama ze sklepu"];

window.onload = function() {
    var elements = document.querySelectorAll('.screen-reader-only');
    Array.prototype.forEach.call(elements, function(el, i) {

        for(var count=0; count < promoted.length; count++) {
            if(el.innerHTML.includes(promoted[count])) {
                var item = el.parentNode.parentNode.parentNode.parentNode.parentNode;
                item.parentNode.removeChild(item);
            }
        }
    });
}