您需要先安装一个扩展,例如 篡改猴、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://greasyfork.org/en/users/2205-ryzhehvost // @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 // @locale en-US // @include * // @version 1.2 // @grant none // ==/UserScript== +function () { var links = document.getElementsByTagName('a'); for (var i=links.length-1; i>=0; i--) { if (links[i].hasAttribute("href")) { if (links[i].getAttribute("href").includes("steampowered")) { links[i].setAttribute("href",links[i].getAttribute("href").replace(/(http.{0,1}:\/\/store\.steampowered\.com\/)(.*)\/(\d+)(.*)/,"$1$2\/$3$4#$2$3")); } } } 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]); } }();