您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show Wowhead tooltips on valid Reddit Wowhead links
当前为
// ==UserScript== // @name Wowhead Tooltips on Reddit // @namespace http://tampermonkey.net/ // @version 1.0 // @license MIT // @description Show Wowhead tooltips on valid Reddit Wowhead links // @author Nighthawk42 // @match https://*.reddit.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // Function to add Wowhead script function addWowheadScript() { let script = document.createElement('script'); script.src = 'https://wow.zamimg.com/widgets/power.js'; script.async = true; document.head.appendChild(script); } // Add Wowhead script to the page addWowheadScript(); // Function to process links and add wowhead-tooltip class function processWowheadLinks() { let links = document.querySelectorAll('a[href*="wowhead.com"]'); links.forEach(link => { link.setAttribute('data-wowhead', link.href); link.setAttribute('rel', 'external'); }); } // Process links on page load processWowheadLinks(); // Listen for new links being added to the page (e.g., infinite scrolling) new MutationObserver(processWowheadLinks).observe(document.body, { childList: true, subtree: true }); })();