您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
購入済みアイテムの背景色を変更します
// ==UserScript== // @name Highlight purchased item on DLsite // @namespace http://tampermonkey.net/ // @version 0.3.4 // @description 購入済みアイテムの背景色を変更します // @author PUMPKIN // @match https://www.dlsite.com/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @license MIT // @run-at document-end // ==/UserScript== (function() { 'use strict'; const backgroundColor = "gray"; // 購入済みアイテムに対して背景色を設定する関数 function highlightPurchasedItems() { document.querySelectorAll('.btn_dl').forEach(btn => { // 割引中、サークル情報等:.search_result_img_box_inner // サークル情報の割引中作品:.n_worklist_item // 検索結果:tr const parent = btn.closest('.search_result_img_box_inner, .n_worklist_item, tr'); if (parent) { parent.style.backgroundColor = backgroundColor; } }); } // 動的な変更を監視して、追加された要素に適用する const observer = new MutationObserver(() => { highlightPurchasedItems(); // DOM に変更があった場合、常に全体を再探索 }); observer.observe(document.body, { subtree: true, childList: true, // 子要素の追加・削除を監視 }); })();