Steam Store - Free Packages Button

This userscript adds a button to the steam licenses page that adds free packages.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Steam Store - Free Packages Button
// @namespace    Royalgamer06
// @version      1.2
// @description  This userscript adds a button to the steam licenses page that adds free packages.
// @author       Royalgamer06
// @include      /^https:\/\/store\.steampowered\.com\/account\/licenses\/?$/
// @connect      steamdb.info
// @grant        GM_xmlhttpRequest
// @grant        unsafeWindow
// @run-at       document-idle
// ==/UserScript==

// ==Code==
jQuery(".breadcrumbs").append("<a id='btnFreePackages' class='btn_green_white_innerfade btn_medium' href='javascript:getFreePackages()' style='float:right;width:170px;'><span style='text-align:center;'>Get Free Packages</span></a>");
unsafeWindow.getFreePackages = function() {
    console.log("Getting free packages...");
    jQuery("#btnFreePackages").html("<center><img alt='ajaxloader' src='//steamcommunity-a.akamaihd.net/public/images/login/throbber.gif'></img></center>").prop("disabled", true);
    GM_xmlhttpRequest({
        method: "GET",
        url: "https://steamdb.info/freepackages/",
        timeout: 30000,
        onload: function(response) {
            var script = jQuery("#freepackages", response.responseText).text();
            console.log(script);
            jQuery("#btnFreePackages").remove();
            console.log("Adding free packages...");
            jQuery.globalEval(script);
        },
        onerror: console.log,
        ontimeout: console.log
    });
};
// ==/Code==