SteamGifts Trades - Have List Filter

Check if you own the games from someone's have list (instant Compare2Steam)

目前為 2016-08-12 提交的版本,檢視 最新版本

// ==UserScript==
// @name         SteamGifts Trades - Have List Filter
// @namespace    Royalgamer06
// @version      0.1
// @description  Check if you own the games from someone's have list (instant Compare2Steam)
// @author       Royalgamer06
// @match        https://www.steamgifts.com/trade/*
// @grant        GM_xmlhttpRequest
// ==/UserScript==

//If you want to set your SteamID64 manually, do it here.
var manual_steamID = "";

//Do not touch below :)
$(document).ready(function() {
    filterHaveList();
});

function filterHaveList() {
    var have = $(".have").text().trim().toLowerCase().replace(/ *\([^)]*\) */g, "").split("\n");
    $.get($(".nav__avatar-outer-wrap").attr("href"), function(data) {
        var steamID = manual_steamID.length > 0 ? manual_steamID : $(".sidebar__shortcut-inner-wrap a", data).attr("href").split("profiles/")[1];
        GM_xmlhttpRequest({
            method: "GET",
            url: "http://steamcommunity.com/profiles/" + steamID + "/games/?xml=1",
            onload: function(data) {
                var xml = $.parseXML(data.responseText);
                var ownedGames = $("name", xml).text().toLowerCase();
                have.forEach(function(game) {
                    if (game.length > 1) {
                        if (ownedGames.indexOf(game) > -1) { //Game is owned
                            $(".have").html($(".have").html().toLowerCase().replace(game, "<i class='fa icon-green fa-check-circle' title='You own this game on steam'></i> " + game));
                        } else { //Game is not owned or unknown game
                            $(".have").html($(".have").html().toLowerCase().replace(game, "<i class='fa icon-red fa-times-circle' title='You do not own this game on steam, or unknown game: \nPlease check manually'></i> " + game + " <a href='https://store.steampowered.com/search/?term=" + encodeURIComponent(game) + "' target='_blank'><i class='fa icon-grey fa-external-link' title='Search game on steam'></i></a>"));
                        }
                    }
                });
            }
        });
    });
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址