Greasy Fork 还支持 简体中文。

Steam SteamDB Button

Adds a button to steam db info near the add to cart button

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Steam SteamDB Button
// @description Adds a button to steam db info near the add to cart button
// @include     https://store.steampowered.com/app/*
// @namespace   https://greasyfork.org/users/8233
// @license MIT
// @version 0.0.1
// ==/UserScript==

var parts = window.location.href.split('/');
if (parts.indexOf('store.steampowered.com') === 2 && parts[3] == 'app') {
  var backs = document.getElementsByClassName('game_purchase_action_bg');
  for (var i = 0; i < backs.length; ++i) {
    //create the link, give it proper href, one of nice steam styles via a class
    var a = document.createElement('a');
    a.href = 'https://steamdb.info/app/' + parts[4];
    a.className = 'btnv6_blue_hoverfade btn_medium';

		// put text in the button
    a.innerHTML = '<span>SteamDB</span>';

    //and add it to each game buy element we can find (in case there are more cus deluxe edition, bundle, etc.)
    var con = backs[i];
    con.insertBefore(a, con.firstChild);

  }
}