SteamAddTo

input SteamAppId then the item is added

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        SteamAddTo
// @namespace	Forbidden Siren
// @version      0.1
// @description  input SteamAppId then the item is added
// @author       You
// @match        https://store.steampowered.com/*
// @grant	GM_registerMenuCommand
// @grant	unsafeWindow
// ==/UserScript==

(function () {
    'use strict';
    GM_registerMenuCommand("AddWishlist", function () {
        const name = prompt("Please input steam", "");
        if (name) {
            const num = parseInt(name);
            if (!isNaN(num)) {
                unsafeWindow.AddToWishlist(num, 'add_to_wishlist_area', 'add_to_wishlist_area_success', 'add_to_wishlist_area_fail', '1_5_9__407');
            }
        }
    });
    GM_registerMenuCommand("AddCart", function () {
        const name = prompt("Please input steam", "");
        if (name) {
            const num = parseInt(name);
            if (!isNaN(num)) {
                unsafeWindow.addToCart(num);
            }
        }
    })
})();