您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Restore the missing subscribe to all button for Steam Workshop.
// ==UserScript== // @name steam-workshop-subscribe-all // @namespace savagecore.uk // @version 0.1.0 // @author SavageCore // @description Restore the missing subscribe to all button for Steam Workshop. // @license Unlicense // @icon https://savagecore.uk/img/userscript_icon.png // @homepageURL https://github.com/SavageCore/steam-workshop-subscribe-all // @supportURL https://github.com/SavageCore/steam-workshop-subscribe-all/issues // @match https://steamcommunity.com/sharedfiles/filedetails/?id=* // @run-at document-idle // ==/UserScript== (function () { 'use strict'; const main = async () => { const workshopItemDescriptionTitle = document.querySelector(".workshopItemDescriptionTitle"); if (!workshopItemDescriptionTitle) { return; } const collectionChildren = document.querySelector(".collectionChildren"); if (!collectionChildren) { return; } const subscribeCollection = document.querySelector(".subscribeCollection"); if (subscribeCollection) { return; } const url = window.location.href; let collectionId = url.split("/").pop(); if (!collectionId) { return; } collectionId = collectionId.replace("?id=", ""); const breadcrumbs = document.querySelector(".breadcrumbs"); if (!breadcrumbs) { return; } const breadcrumbsLinks = breadcrumbs.querySelectorAll("a"); const appLink = breadcrumbsLinks[0]; const appHref = appLink.getAttribute("href"); if (!appHref) { return; } const appId = appHref.split("/").pop(); const html = ` <div class="subscribeCollection"> <a class="general_btn subscribe" title="Unofficial - userscript!" onclick="SubscribeCollection( '${collectionId}', '${appId}' );"> <div class="subscribeIcon"></div> <span class="subscribeText">Subscribe to all</span> </a> <span class="general_btn subscribe" title="Unofficial - userscript!" onclick="UnsubscribeCollection( '${collectionId}' )"> <div class="unsubscribeIcon"></div> <span>Unsubscribe from all</span> </span> <div style="clear: right"></div> </div>`; collectionChildren.insertAdjacentHTML("beforebegin", html); }; main(); })();