您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirects links to removed AppID's on steampowered.com to steamdb.info
// ==UserScript== // @name Redirect Removed Steam ID to steamdb // @namespace https://gf.qytechs.cn/en/users/2205 // @description Redirects links to removed AppID's on steampowered.com to steamdb.info // @description:en Redirects links to removed AppID's on steampowered.com to steamdb.info // @license Apache-2.0 // @author Rudokhvist // @locale en-US // @include * // @version 1.4 // @grant none // ==/UserScript== function addanchors(element) { try { var links = element.getElementsByTagName('a'); for (var i=links.length-1; i>=0; i--) { if (links[i].hasAttribute("href")) { if (links[i].getAttribute("href").includes("steampowered")) { if (!links[i].getAttribute("href").includes("#")){ links[i].setAttribute("href",links[i].getAttribute("href").replace(/(http.{0,1}:\/\/store\.steampowered\.com\/)([^\/]*)\/(\d+)(.*)/,"$1$2\/$3$4#$2$3")); } } } } return null; } catch (e) { console.log("Redirect Removed Steam ID to steamdb error"); return null; } } +function () { var res; if (res=window.location.href.match(/http.{0,1}:\/\/store\.steampowered\.com\/#(\D+)(\d+)/)) { window.location = "https:\/\/steamdb.info\/"+res[1]+"\/"+res[2]; } else if (res=window.location.href.match(/(http.{0,1}:\/\/store\.steampowered\.com\/.+)#(\D+)(\d+)/)){ window.history.replaceState(null, null, res[1]); } addanchors(document); var mutationObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { mutation.addedNodes.forEach( function(currentValue, currentIndex, listObj) { if (currentValue.nodeType == Node.ELEMENT_NODE) { addanchors(currentValue); } }); }); }); mutationObserver.observe(document.documentElement, { childList: true, subtree: true }); }();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址