Greasy Fork

Greasy Fork is available in English.

steam+

在steam页面对着一个商品按ctrl+右键,即可快速打开该商品的steamdb链接,用于查看其价格曲线等。

当前为 2021-06-24 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         steam+
// @namespace    http://tampermonkey.net/
// @version      0.2
// @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=img.substr(page_substr.index,page_substr[0].length)
        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){
                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
                        }
                    }
                }
                var page_substr=img.match(/\d{3,7}/)
                var last_id=img.substr(page_substr.index,page_substr[0].length)
                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()
                //alert("首页")
            }
        }
    })
})();