您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a open in steam button to workshop links.
当前为
// ==UserScript== // @name Steam Workshop Open in Steam // @namespace http://tampermonkey.net/ // @version 1.0 // @description Adds a open in steam button to workshop links. // @match https://steamcommunity.com/sharedfiles/filedetails/?id=* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function addOpenInSteamButton() { var workshopId = new URLSearchParams(window.location.search).get('id'); if (workshopId) { var button = document.createElement('a'); button.textContent = 'Open in Steam'; button.href = 'steam://url/CommunityFilePage/' + workshopId; button.style.cssText = 'display: inline-block; padding: 10px 15px; background-color: #1b2838; color: white; text-decoration: none; border-radius: 3px; margin: 10px 0;'; var targetElement = document.querySelector('.workshopItemTitle'); if (targetElement) { targetElement.parentNode.insertBefore(button, targetElement.nextSibling); } } } // Run the function when the page is fully loaded if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', addOpenInSteamButton); } else { addOpenInSteamButton(); } })();