uniqlo_hide_item2

指定したユニクロのアイテムを非表示にする。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        uniqlo_hide_item2
// @namespace   uniqlo_hide_item2.user.js
// @include     https://www.uniqlo.com/*
// @run-at      document-end
// @author      greg10
// @license     GPL 3.0
// @version     2.0
// @grant       none
// @description 指定したユニクロのアイテムを非表示にする。
// ==/UserScript==

console.log("uniqlo_hide_item2 start");

///////////////////////////////////////////////////////////////
// 設定:非表示にするアイテムの画像リスト
///////////////////////////////////////////////////////////////
var ignore_list = [
"https://im.uniqlo.com/images/jp/pc/goods/408117/item/08_408117_middles.jpg",
"https://im.uniqlo.com/images/jp/pc/goods/408116/item/08_408116_middles.jpg",
];

// https://www.uniqlo.com/jp/store/feature/uq/sale/men/
function proc() {
	document.querySelectorAll(".unit").forEach( function(elem) {
		var img = elem.querySelector("dd.thumb > a > img");
		var img_src = img.getAttribute("src");
		for (var i = 0, len = ignore_list.length; i < len; i++) {
			if ( img_src == ignore_list[i]) {
				console.log("img_src="+img_src);
				elem.style.display = "none";
			}
		}
	});

}

function main() {
	proc();
}
main();


var observer = new MutationObserver(function(mutations) {
    observer.disconnect();
    main();
    observer.observe( document, config);
});

var config = { attributes: false, childList: true, characterData: false, subtree:true };

observer.observe( document, config);