您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Detects dynamic osu page changes
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/441010/1025088/OsuPageObserver.js
class OsuWebObserver { constructor(staticFn, dynamicFn) { this.static = staticFn; this.dynamic = dynamicFn; this.static(); const pageType = this.getType(); if (pageType === "dynamic") { const firstLoad = new MutationObserver(() => { this.dynamic(); firstLoad.disconnect(); }); const layout = document.querySelector(".osu-layout__section")?.firstElementChild; if (layout != null) { firstLoad.observe(layout, {childList: true}); } } this.pageObserver = new MutationObserver(this.detectPageChange); this.pageObserver.observe(document.documentElement, {childList: true}); } detectPageChange = (mutations) => { for (const mutation of mutations) { if (mutation.addedNodes.length > 0) { mutation.addedNodes.forEach(node => { if (node.nodeName == "BODY") { this.static(); this.dynamic(); return; } }); } } } getType = () => { const type = location.pathname.split("/")[1]; const dynamic = ["users", "beatmapsets", "scores"]; if (dynamic.includes(type)) { return "dynamic"; } return "static"; } destroy = () => { this.pageObserver.disconnect(); } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址