hidden_no_need

hidden uq sale

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         hidden_no_need
// @namespace    https://mesak.tw
// @version      0.1
// @description  hidden uq sale
// @author       You
// @match        https://uq.goodjack.tw/lists/sale
// @icon         https://www.google.com/s2/favicons?sz=64&domain=goodjack.tw
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==
GM_addStyle(`
.card:has(.hide) {
    display: none !important;
}
`);
(function() {
    'use strict';
    [...document.querySelectorAll('span')].filter(ele=>!ele.textContent.indexOf('已售罄')).forEach( node => node.classList.add('hide') );

    [...document.querySelectorAll('h2')].forEach( (node) => {
        let putNode = document.createElement("div");
        putNode.innerHTML = `
<span class="ts horizontal basic label">售完</span>
<span class="ts negative horizontal basic label">UNIQLO</span>
<span class="ts info horizontal basic label">GU</span>
`
        node.append(putNode)
    })
})();