Greasy Fork is available in English.

Steam Blocked Helper

Add action buttons to the blocked games and remove them from the queue

Od 01.01.2019.. Pogledajte najnovija verzija.

// ==UserScript==
// @name         Steam Blocked Helper
// @name:zh-CN   Steam队列锁区辅助
// @namespace    https://store.steampowered.com/agecheck/app/*
// @version      0.1
// @description  Add action buttons to the blocked games and remove them from the queue
// @description:zh-CN 为锁区的游戏添加按钮选项并从队列中移除
// @author       wweeiiyyiinn
// @match        https://store.steampowered.com/agecheck/app/*
// @grant        none
// ==/UserScript==


(function() {
    'use strict';
    function add_buttons(appid){
        function load_script(){
            var gamejs = document.createElement('script');
            gamejs.type = "text/javascript";
            gamejs.src = "https://steamstore-a.akamaihd.net/public/javascript/game.js";
            document.head.appendChild(gamejs);
            document.head.innerHTML += '<link href="https://steamstore-a.akamaihd.net/public/css/v6/game.css" rel="stylesheet" type="text/css">';
            document.head.innerHTML += '<link href="https://steamstore-a.akamaihd.net/public/shared/css/buttons.css" rel="stylesheet" type="text/css">';
        }
        function add_actions(){
            function init() {
                if (window.InitQueueControls && document.getElementById('add_to_wishlist_area')){
                    window.InitQueueControls(Number(appid), Number(appid), 955560, '1_5_9_');
                } else {
                    setTimeout(init, 10);
                }
            }
            init();
        }
        function add_elements(){
            var box = document.getElementById('error_box');
            box.style.paddingBottom = '0px';
            var content = box.parentElement;
            var controlHTML = '<div class="queue_overflow_ctn"><div class="queue_ctn "><div class="queue_actions_ctn"><a href="https://store.steampowered.com/explore/" class="btnv6_blue_hoverfade  btn_medium  right" data-tooltip-text="View and customize your personal Discovery Queue."><span>View Your Queue&nbsp;&nbsp;&nbsp;<i class="ico16 arrow_next"></i></span></a><div id="add_to_wishlist_area"><a data-tooltip-text="Get notified by email when your wishlisted items get released or are on sale" href="javascript:AddToWishlist( appid, \'add_to_wishlist_area\', \'add_to_wishlist_area_success\', \'add_to_wishlist_area_fail\', \'1_5_9__407\' );" class="btnv6_blue_hoverfade btn_medium"><span>Add to your wishlist</span></a></div><div id="add_to_wishlist_area_success" style="display: none;"><a href="profileSrc/wishlist" class="btnv6_blue_hoverfade btn_medium queue_btn_active" data-tooltip-text="This product is already on your wishlist. Click to view your wishlist."><span><img src="https://steamstore-a.akamaihd.net/public/images/v6/ico/ico_selected.png" border="0">On Wishlist</span></a></div><div id="add_to_wishlist_area_fail" style="display: none;"><b>Oops, sorry!</b></div><div class="queue_control_button queue_btn_follow"><div class="btnv6_blue_hoverfade btn_medium queue_btn_inactive" style="" data-tooltip-text="Follow this item to see announcements in your community activity feed."><span>Follow</span></div><div class="btnv6_blue_hoverfade btn_medium queue_btn_active" style="display: none;"><span><img src="https://steamstore-a.akamaihd.net/public/images/v6/ico/ico_selected.png" border="0"> Following</span></div></div><div class="queue_control_button queue_btn_ignore"><div class="btnv6_blue_hoverfade  btn_medium queue_btn_inactive" style="" data-tooltip-text="Ignored titles will not be recommended to you and will not appear in featured areas."><span>Ignore</span></div><div class="btnv6_blue_hoverfade  btn_medium queue_btn_active" style="display: none;" data-tooltip-text="Ignored titles will not be recommended to you and will not appear in featured areas."><span><img src="https://steamstore-a.akamaihd.net/public/images/v6/ico/ico_selected.png" border="0"> Ignored</span></div></div><div style="clear: both;"></div><a class="btnv6_blue_hoverfade btn_medium steamdb_ico" target="_blank" href="https://steamdb.info/app/appid/"><span>Steam Database</span></a></div></div></div>'
            var profileSrc = document.body.innerHTML.match(/(https:\/\/steamcommunity.com\/profiles\/\d+)\/?/)[1];
            content.innerHTML += controlHTML.replace(/appid/g, appid).replace(/profileSrc/g, profileSrc);
            var headerImg = document.createElement('img');
            headerImg.src = 'https://steamcdn-a.akamaihd.net/steam/apps/appid/header.jpg'.replace('appid', appid);
            content.appendChild(headerImg);
        }
        load_script();
        add_elements();
        add_actions();
    }
    function remove_from_queue(appid){
        window.jQuery.post("/app/7", { sessionid: window.g_sessionID, appid_to_clear_from_queue: appid });
    }
    if (!document.title.match(/Steam/)){
        var appid = location.href.match(/\/app\/(\d+)\//)[1];
        remove_from_queue(appid);
        add_buttons(appid);
    }
})();