您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds two buttons to the Add / Edit Child Items screen related to removing unsubscribed items and adding subscribed items.
当前为
// ==UserScript== // @namespace https://github.com/pointfeev // @name Steam Subscription Collection Manager // @version 1.0 // @description Adds two buttons to the Add / Edit Child Items screen related to removing unsubscribed items and adding subscribed items. // @author pointfeev // @match https://steamcommunity.com/sharedfiles/managecollection/* // @icon https://steamcommunity.com/favicon.ico // @grant none // ==/UserScript== (function() { 'use strict'; var collection_id = new URL(document.location.href).searchParams.get('id'); var g_sessionID = window.g_sessionID; var collection_window = document.querySelector('div.collectionAddItemsSection'); var working = false; var btn_rem = document.createElement('a'); jQuery(btn_rem).text('Remove all unsubscribed items'); btn_rem.style.position = 'absolute'; btn_rem.style.top = '130px'; btn_rem.style.right = '50px'; jQuery(btn_rem).addClass("collectionChoiceTab"); btn_rem.style.background = '#FF6666'; collection_window.insertBefore(btn_rem, collection_window.firstChild); jQuery(btn_rem).click(function() { if (working) { return; } working = true; var button = jQuery(this); var collection_id = new URL(document.location.href).searchParams.get('id'); var g_sessionID = window.g_sessionID; var i = 0; jQuery('div#sortable_items div.managedCollectionItem').each(function() { var item = jQuery(this); var childID = item.attr('id').replace('sharedfile_', ''); if (jQuery("#choice_MySubscribedItems_" + childID).length) { return; } i++; button.html("Removing " + i + " items . . ."); jQuery.ajax({ type: "POST", url: "https://steamcommunity.com/sharedfiles/removechild", data: { id: collection_id, sessionid: g_sessionID, childid: childID }, success: function () { item.remove(); var listItems = ["#choice_MyItems_" + childID, "#choice_MyFavoriteItems_" + childID, "#choice_MySubscribedItems_" + childID]; for (var i = 0; i < listItems.length; ++i) { var listElem = jQuery(listItems[i]); if (listElem) { listElem.removeClass("inCollection"); } } } }).done(function() { i--; button.html("Removing " + i + " items . . ."); if (i == 0) { location.reload(); } }); }); if (i == 0) { working = false; } }); var btn_add = document.createElement('a'); jQuery(btn_add).text('Add all subscribed items'); btn_add.style.position = 'absolute'; btn_add.style.top = '160px'; btn_add.style.right = '50px'; jQuery(btn_add).addClass("collectionChoiceTab"); btn_add.style.background = '#90EE90'; collection_window.insertBefore(btn_add, collection_window.firstChild); jQuery(btn_add).click(function() { if (working) { return; } working = true; var button = jQuery(this); var collection_id = new URL(document.location.href).searchParams.get('id'); var g_sessionID = window.g_sessionID; var i = 0; jQuery('div#MySubscribedItems div.itemChoice:not(.inCollection)').each(function() { var childID = jQuery(this).attr('id').replace('choice_MySubscribedItems_', ''); i++; button.html("Adding " + i + " items . . ."); jQuery.ajax({ type: "POST", url: "https://steamcommunity.com/sharedfiles/addchild", data: { id: collection_id, sessionid: g_sessionID, childid: childID }, success: function () { var listItems = ["#choice_MyItems_" + childID, "#choice_MyFavoriteItems_" + childID, "#choice_MySubscribedItems_" + childID]; for (var i = 0; i < listItems.length; ++i) { var listElem = jQuery(listItems[i]); if (listElem) { listElem.addClass("inCollection"); } } } }).done(function() { i--; button.html("Adding " + i + " items . . ."); if (i == 0) { location.reload(); } }); }); if (i == 0) { working = false; } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址