您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A Tampermonkey userscript to hide foreign currency information on SteamDB
// ==UserScript== // @name SteamDB Hide Foreign Currencies // @namespace https://github.com/Drakmyth/tampermonkey-userscripts // @version 0.2 // @author Drakmyth // @description A Tampermonkey userscript to hide foreign currency information on SteamDB // @homepage https://github.com/Drakmyth/tampermonkey-userscripts // @supportURL https://github.com/Drakmyth/tampermonkey-userscripts/issues?q=is%3Aopen+is%3Aissue+label%3Asteamdb-hide-foreign-currencies // @license MIT // @match https://steamdb.info/app/* // @match https://steamdb.info/bundle/* // @match https://steamdb.info/sub/* // @run-at document-body // @grant none // ==/UserScript== (function () { `use strict`; const toggleButtonId = `tmnky-hide-foreign-currencies`; let hideForeignCurrencies = true; function doesToggleButtonExist() { const controlContainer = getControlContainer(); return controlContainer.querySelector(`button#${toggleButtonId}`); } function getCurrentStateButtonText() { return `${hideForeignCurrencies ? `Show` : `Hide`} Foreign Currencies`; } function addToggleButton() { const toggleButton = createToggleButton(getCurrentStateButtonText(), toggleShowForeignCurrencies) const controlContainer = getControlContainer(); controlContainer.insertBefore(toggleButton, controlContainer.firstChild); } function getControlContainer() { return document.getElementById('js-currency-selector').parentElement; } function createToggleButton(text, onClick) { const toggleButton = document.createElement(`button`); toggleButton.className = `btn btn-outline`; toggleButton.id = toggleButtonId; toggleButton.onclick = onClick; toggleButton.textContent = text; return toggleButton; } function toggleShowForeignCurrencies(event) { hideForeignCurrencies = !hideForeignCurrencies; event.target.textContent = getCurrentStateButtonText(); onBodyChange(); } function isCurrentCurrency(row) { return !hideForeignCurrencies || row.classList.contains(`table-prices-current`); } function onBodyChange(mut) { const priceRows = document.querySelectorAll(`.table-prices>tbody>tr`); for (let row of priceRows) { row.style.display = isCurrentCurrency(row) ? null : `none`; } } function onDOMContentLoaded() { if (!doesToggleButtonExist()) { addToggleButton(); } } document.addEventListener(`DOMContentLoaded`, onDOMContentLoaded, false); const mo = new MutationObserver(onBodyChange); mo.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址