Etsy - Remove Promoted Ads

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

当前为 2022-12-30 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);
}