您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide DLCs in the store page by default. Doesn't work on some links
// ==UserScript== // @name GOG - Hide DLCs by default // @namespace amekusa.gog-hide-dlcs // @author amekusa // @version 1.0.1 // @description Hide DLCs in the store page by default. Doesn't work on some links // @match https://www.gog.com/* // @run-at document-start // @grant none // @license MIT // @homepage https://github.com/amekusa/monkeyscripts // ==/UserScript== (function (doc) { // url params to add to the store links let params = 'hideDLCs=true'; // params += '&discounted=true'; // option: Show only discounted // params += '&hideOwned=true'; // option: Hide all owned products let addParams = link => { let href = link.getAttribute('href'); link.setAttribute('href', href + (href.includes('?') ? '&' : '?') + params); }; let update = () => { let links = []; let exclude = `:not([href*="${params}"])`; links.push(doc.querySelectorAll('a[href$="/games"]' + exclude)); links.push(doc.querySelectorAll('a[href*="/games?"]' + exclude)); links.push(doc.querySelectorAll('a[href*="/games/"]' + exclude)); // links.push(doc.querySelectorAll('a[href*="/promo/"]' + exclude)); for (let i = 0; i < links.length; i++) links[i].forEach(addParams); }; doc.addEventListener('DOMContentLoaded', update); doc.addEventListener('scrollend', update); })(document);