您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Modernized take on Bradley Sattem's (a.k.a. Aichon) idea to underline all related profile links on mouse hover
// ==UserScript== // @name UD Underline Related Profile Links // @namespace Avarice77 // @match https://urbandead.com/map.cgi* // @match https://www.urbandead.com/map.cgi* // @match https://ispy.dxavier.net/* // @run-at document-end // @inject-into auto // @grant none // @license MIT // @version 1.2 // @author Avarice77 // @description Modernized take on Bradley Sattem's (a.k.a. Aichon) idea to underline all related profile links on mouse hover // ==/UserScript== const debug = false; const profileEl = document.querySelectorAll('.gt')[0].querySelector('a'); const playerId = profileEl.href.substring(profileEl.href.indexOf('id=') + 3); if (debug) console.debug(`Your playerId:`, playerId); const allProfiles = Array.from(document.querySelectorAll('a[href*="profile.cgi"]:not(.y)')); allProfiles.forEach((profile, index) => { if (!profile.href.includes(playerId)) { const profileId = profile.href.substring(profile.href.indexOf('id=') + 3); if (debug) console.debug(`Processing profileId: ${profileId}`); profile.addEventListener('mouseover', (e) => { const relatedProfiles = []; allProfiles.forEach((otherProfile) => { const otherProfileId = otherProfile.href.substring(otherProfile.href.indexOf('id=') + 3); if (otherProfileId === profileId) { relatedProfiles.push(otherProfile); otherProfile.style.textDecoration = 'underline'; } else { otherProfile.style.textDecoration = 'none'; } }); if (debug) console.debug(`Processing related profiles of profileId: ${profileId}`, relatedProfiles); }); profile.addEventListener('mouseout', (e) => { allProfiles.forEach((profile) => { profile.style.textDecoration = 'none'; }); }); if (debug) console.debug(`Added even listeners for profileId: ${profileId}`); } });