您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fixes the weird math test images in Agilix Buzz
当前为
// ==UserScript== // @name Better Buzz Maths // @namespace https://greasyfork.org/users/1359538 // @version 1.3 // @description Fixes the weird math test images in Agilix Buzz // @license MIT // @icon https://www.google.com/s2/favicons?sz=64&domain=agilixbuzz.com // @homepage https://greasyfork.org/scripts/505681 // @match https://legacy.agilixbuzz.com/* // @grant none // ==/UserScript== (function() { 'use strict'; const url = /cdn\.flvs\.net\/.*math_.*/; const processDelay = 100; let imgQueue = []; let processing = false; function processQueue() { if (processing) return; processing = true; processImg(); } function processImg() { if (imgQueue.length === 0) { processing = false; return; } const img = imgQueue.pop(); fixImg(img); setTimeout(processImg, processDelay); } function queueImg(img) { if (url.test(img.src)) { imgQueue.push(img); processQueue(); } } function fixImg(img) { img.style.filter = 'brightness(0.5) invert(1)'; } document.querySelectorAll('img').forEach(img => queueImg(img)); const observer = new MutationObserver((mutationsList) => { for (const mut of mutationsList) { if (mut.type === 'childList') { for (const n of mut.addedNodes) { if (n.tagName === 'IMG') { queueImg(n); } else if (n.nodeType === Node.ELEMENT_NODE) { n.querySelectorAll('img').forEach(img => queueImg(img)); } } } } }); observer.observe(document.body, {childList: true, subtree: true}); }());