Greasy Fork is available in English.
蝦皮搜尋結果的前幾個商品廣告封鎖
当前为
// ==UserScript==
// @name 蝦皮廣告封鎖器
// @namespace http://greasyfork.icu/scripts/437545
// @version 0.2
// @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
// ==/UserScript==
(function() {
'use strict';
// 定时器
setIntervalX(() => {
$(".col-xs-2-4.shopee-search-item-result__item").each(function() {
if ($(this).text().indexOf("廣告") != -1){
$(this).hide();
}
});
}, 100, 10)
})();
function setIntervalX(callback, delay, repetitions) {
var x = 0;
var intervalID = window.setInterval(function () {
callback();
if (++x === repetitions) {
window.clearInterval(intervalID);
}
}, delay);
}