您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show nicknames for friends with cards on Badge Page if exists
当前为
// ==UserScript== // @name Steam Community - Show Nicknames on Badge Page // @icon https://store.steampowered.com/favicon.ico // @namespace https://github.com/tkhquang // @version 1.00 // @description Show nicknames for friends with cards on Badge Page if exists // @author Quang Trinh // @license MIT; https://raw.githubusercontent.com/tkhquang/userscripts/master/LICENSE // @match *://steamcommunity.com/*/*/gamecards/* // @run-at document-idle // @grant none // ==/UserScript== (function () { "use strict"; Array.from(document.querySelectorAll(".badge_friendwithgamecard .persona")) .forEach(friend => { fetch(`https://steamcommunity.com/miniprofile/${friend.getAttribute("data-miniprofile")}`) .then( function(response) { if (response.status !== 200) { console.log(`An error occured. Status Code: ${response.status}`); return; } response .text() .then(html => { const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); friend.innerText = doc.querySelector(".persona").innerText; }); } ) .catch(err => { console.log("Fetch Error :-S", err); }); }); }());