// ==UserScript== // @name 蝦皮廣告封鎖器 // @namespace https://greasyfork.org/scripts/437545 // @version 0.3 // @description 蝦皮搜尋結果的前幾個商品廣告封鎖 // @author fmnijk // @match https://shopee.tw/* // @icon https://www.google.com/s2/favicons?domain=shopee.tw // @grant none // @license MIT // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 定时器 setIntervalX(() => { $(".col-xs-2-4.shopee-search-item-result__item").each(function() { if ($(this).text().indexOf("廣告") != -1){ $(this).hide(); } }); }, 100, 20) })(); function setIntervalX(callback, delay, repetitions) { var x = 0; var intervalID = window.setInterval(function () { callback(); if (++x === repetitions) { window.clearInterval(intervalID); } }, delay); }