您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Converts randomfriend links to userlookup and places &place=999999 before user= for all formats (user= or randomfriend=)
当前为
// ==UserScript== // @name QoL Update: Neopets Userlookup Skip ReCaptcha // @namespace http://tampermonkey.net/ // @version 1.4 // @description Converts randomfriend links to userlookup and places &place=999999 before user= for all formats (user= or randomfriend=) // @author Fatal // @match *.neopets.com/* // @license MIT // @grant none // @run-at document-end // ==/UserScript== (function () { 'use strict'; function modifyUserUrl(url) { const base = 'https://www.neopets.com/userlookup.phtml'; // Match user or randomfriend params const match = url.match(/[?&](user|randomfriend)=([^&]+)/); if (url.includes('randomfriend.phtml') && match) { const username = match[2]; return `${base}?place=999999&user=${username}`; } // Handle existing userlookup links if (url.includes('userlookup.phtml') && match) { const username = match[2]; // Clean the URL from existing user/place parameters let cleanUrl = url.replace(/[?&]place=[^&]*/g, '').replace(/[?&]user=[^&]*/g, ''); cleanUrl = cleanUrl.split('?')[0]; // remove remaining query string return `${base}?place=999999&user=${username}`; } return url; } function modifyAllLinks() { const links = document.getElementsByTagName('a'); for (let link of links) { const originalHref = link.href; const modifiedHref = modifyUserUrl(originalHref); if (modifiedHref !== originalHref) { link.href = modifiedHref; } } } modifyAllLinks(); const observer = new MutationObserver(modifyAllLinks); observer.observe(document.body, { childList: true, subtree: true }); })();