您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a "Friends That Play" button after the Store Page button, and removes the apphub_OtherSiteInfo div to avoid issues on Steam gamecards pages.
- // ==UserScript==
- // @name Add "Friends That Play" Button on Steam Gamecards
- // @namespace https://github.com/encumber
- // @version 1.3
- // @description Adds a "Friends That Play" button after the Store Page button, and removes the apphub_OtherSiteInfo div to avoid issues on Steam gamecards pages.
- // @author Nitoned
- // @match https://steamcommunity.com/id/*/gamecards/*
- // @grant none
- // ==/UserScript==
- (function () {
- 'use strict';
- const yourid = "yourid"
- const appIdMatch = window.location.pathname.match(/\/gamecards\/(\d+)/);
- if (!appIdMatch) return;
- const appId = appIdMatch[1];
- const interval = setInterval(() => {
- // Remove any div with the class apphub_OtherSiteInfo
- const otherSiteDiv = document.querySelector('div.apphub_OtherSiteInfo');
- if (otherSiteDiv) {
- otherSiteDiv.remove();
- }
- // Look for the correct Store Page button
- const allLinks = document.querySelectorAll('a');
- let storePageButton = null;
- for (const link of allLinks) {
- const span = link.querySelector('span');
- if (span && span.textContent.trim() === 'Store Page') {
- storePageButton = link;
- break;
- }
- }
- if (storePageButton) {
- clearInterval(interval);
- const newLink = document.createElement('a');
- newLink.href = `https://steamcommunity.com/id/${yourid}/friendsthatplay/${appId}`;
- newLink.className = storePageButton.className;
- newLink.style.marginLeft = '6px';
- const newSpan = document.createElement('span');
- newSpan.className = storePageButton.querySelector('span')?.className || '';
- newSpan.textContent = 'Friends That Play';
- newLink.appendChild(newSpan);
- storePageButton.parentNode.insertBefore(newLink, storePageButton.nextSibling);
- }
- }, 500);
- })();