您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
steampy Game Details Interface steam Store link div replaced with a
// ==UserScript== // @name steampy 游戏详情界面 steam 商店链接 div 替换为 a // @namespace https://github.com/Yanren1225/steampy-cdkdetail-store-link-replacer // @match https://steampy.com/cdkDetail // @homepageURL https://github.com/Yanren1225/steampy-cdkdetail-store-link-replacer // @supportURL https://github.com/Yanren1225/steampy-cdkdetail-store-link-replacer/issues // @version 0.1.0 // @author Yanren // @modified 2023-06-25 // *run-at document-end // @description steampy Game Details Interface steam Store link div replaced with a // ==/UserScript== (function () { "use strict"; const observer = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { if (!mutation.addedNodes) return; for (let i = 0; i < mutation.addedNodes.length; i++) { const node = mutation.addedNodes[i]; if (node.nodeType !== 1) continue; const nodesList = Array.from(node.querySelectorAll("div")); const nodeIndex = nodesList.findIndex((item) => { return item.innerText.indexOf("https://store.steampowered.com") === 0; }); if (nodeIndex > -1) { const targetNode = nodesList[nodeIndex]; const text = targetNode.textContent; const href = targetNode.textContent.trim(); const classList = targetNode.classList; const anchorElement = document.createElement("a"); anchorElement.href = href; anchorElement.text = text; anchorElement.classList = classList; targetNode.parentNode.replaceChild(anchorElement, targetNode); return; } } }); }); observer.observe(document.body, { childList: true, subtree: true, }); })();