您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the Classic (CL) mod from top plays on osu! user profiles
// ==UserScript== // @name osu! Remove Classic (CL) Mod from Top Plays // @namespace https://osu.ppy.sh/users/ // @version 1.3 // @description Removes the Classic (CL) mod from top plays on osu! user profiles // @author MrTerror // @match https://osu.ppy.sh/users/* // @grant none // @run-at document-end // ==/UserScript== (function () { 'use strict'; function removeClassicMod() { document.querySelectorAll('.mod--CL').forEach(mod => mod.remove()); } // Initial run removeClassicMod(); // Observe specific container for top plays const getTargetContainer = () => ( document.querySelector('.js-react--user-page') || document.querySelector('.user-profile') || document.body ); let targetContainer = getTargetContainer(); const observer = new MutationObserver(removeClassicMod); observer.observe(targetContainer, { childList: true, subtree: true }); // Re-observe if container changes const containerCheck = setInterval(() => { const newContainer = getTargetContainer(); if (newContainer !== targetContainer) { targetContainer = newContainer; observer.observe(targetContainer, { childList: true, subtree: true }); removeClassicMod(); } }, 1000); // Handle navigation window.addEventListener('popstate', removeClassicMod); const originalPushState = history.pushState; history.pushState = function (...args) { originalPushState.apply(this, args); removeClassicMod(); }; const originalReplaceState = history.replaceState; history.replaceState = function (...args) { originalReplaceState.apply(this, args); removeClassicMod(); }; })();