Etsy - Remove Promoted Ads

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

目前為 2022-12-30 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Etsy - Remove Promoted Ads
// @author       RandomUsername404
// @namespace    https://greasyfork.org/en/users/105361-randomusername404
// @version      1.4
// @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 = ["Publicité d'", "Anzeige des", "Ad by", "Anuncio del", "Annuncio di", "Etsy セラーによる広告", "Advertentie van", "Reklama sprzedawcy", "Anúncio de", "Реклама от"];

window.onload = function() {
    setInterval(function(){
      var elements = document.querySelectorAll('[data-ad-label]').forEach((el, i) => {

          for(var count=0; count < promoted.length; count++) {

              if(el.innerText.includes(promoted[count])) {
                  var item = el.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
                  item.parentNode.removeChild(item);

                  console.log("Ads removed.");
              }
          }
      });
    }, 1700);
}