您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
When items in your GOG.com wishlist are discounted, only the discounted items will be shown. Provides a toggle to display all items and remembers your last setting.
// ==UserScript== // @name GOG.com Wishlist Discounted Items Toggle // @version 1.0 // @namespace https://gf.qytechs.cn/users/219548 // @description When items in your GOG.com wishlist are discounted, only the discounted items will be shown. Provides a toggle to display all items and remembers your last setting. // @author mnnks // @grant GM_setValue // @grant GM_getValue // @include https://www.gog.com/account/wishlist // ==/UserScript== function conjureUpStylesheet() { var stylesheet = document.createElement("style"); stylesheet.type = "text/css"; stylesheet.textContent = ".account__products .product-row {\ndisplay: none;\n}\n\n.account__products .is-discounted"; stylesheet.textContent += "{\ndisplay: block;\n}\n\n.discount-toggle .menu-link {\ncolor: white;\n}"; document.body.appendChild(stylesheet); // check the last stored setting to determine if we need to deactivate the stylesheet stylesheet.disabled = displayAllItems; return stylesheet; } var numberOfDiscountedItems = document.getElementsByClassName("is-discounted").length; if (numberOfDiscountedItems) { //displayDiscountedCount(numberOfDiscountedItems); // probleem met 'clear filters' //var displayAllItems = confirm('Show only discounted items?'); var displayAllItems = GM_getValue("displayAllItems", false); // create stylesheet to hide nondiscounted items var cssDiscountedOnly = conjureUpStylesheet(); // create toggle switch... var discountedToggleDiv = document.createElement("div"); discountedToggleDiv.className = "menu-tray"; discountedToggleDiv.innerHTML = '<div class="menu-item discount-toggle"><a class="menu-link menu-link" id="toggleDiscounted">-%</a></div>'; // ...and inject it into the menu bar var menu = document.getElementsByClassName("menu__container"); menu[0].appendChild(discountedToggleDiv); function toggleDiscountedOnly() { displayAllItems = !displayAllItems; cssDiscountedOnly.disabled = displayAllItems; GM_setValue("displayAllItems", displayAllItems); } document.getElementById("toggleDiscounted").addEventListener("click", toggleDiscountedOnly); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址