您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在steam页面对着一个商品按ctrl+右键,即可快速打开该商品的steamdb链接,用于查看其价格曲线等。
当前为
// ==UserScript== // @name steam+ // @namespace http://tampermonkey.net/ // @version 0.4 // @description 在steam页面对着一个商品按ctrl+右键,即可快速打开该商品的steamdb链接,用于查看其价格曲线等。 // @author Pikaqian // @match https://store.steampowered.com/* // @icon https://store.steampowered.com/favicon.ico // @grant none // ==/UserScript== (function() { 'use strict'; var match_bundle=/bundle\/\d{3,7}\// var match_app=/app\/\d{3,7}\// var match_sub=/sub\/\d{3,7}\// var page_url=window.location.href,img function openUrl(type,img){ var page_substr=img.match(/\d{3,7}/) var last_id=page_substr[0] window.open("https://steamdb.info/"+type+"/"+last_id+"/") event.preventDefault() } window.addEventListener('contextmenu',function (event){ if(event.ctrlKey==true){ if(page_url.match(match_bundle)!=null){ openUrl("bundle",page_url) } else if(page_url.match(match_app)!=null){ var count=0 elemA=event.target for(var l=0;l<6;l++){ if(elemA.id=="recommended_block_content"){ count=1 break } else{ elemA=elemA.parentNode count=0 } } if(count==1){ elemA=event.target for(var o=0;o<4;o++){ if(event.target.localName=="a"){ img=event.target.href break } else{ elemA=elemA.parentNode if(elemA.localName=="a"){ img=elemA.href break } } } var page_substr=img.match(/\d{3,7}/) var last_id=page_substr[0] window.open("https://steamdb.info/app/"+last_id+"/") event.preventDefault() } else{ openUrl("app",page_url) } } else if(page_url.match(match_sub)!=null){ openUrl("sub",page_url) } else{ var lala=event.target var elemA=event.target for(var i=0;i<10;i++){ if(event.target.localName=="a"){ img=event.target.href } else{ elemA=elemA.parentNode if(elemA.localName=="a"){ img=elemA.href break } } } page_substr=img.match(/\d{3,7}/) last_id=page_substr[0] for(var k=0;k<elemA.href.split("/").length;k++){ if(elemA.href.split("/")[k]=="store.steampowered.com"){ var type=elemA.href.split("/")[k+1] } } window.open("https://steamdb.info/"+type+"/"+last_id+"/") event.preventDefault() } } }) })();