// ==UserScript==// @name         YouTube Connection Speed → Mbps// @namespace    http://tampermonkey.net/// @version      4.1// @description  将YT视频测速中Kbps改为Mbps// @match        https://www.youtube.com/*// @grant        none// ==/UserScript==(function() {    'use strict';    function updateSpeed() {        const divs = document.querySelectorAll("div");        divs.forEach(div => {            if (div.textContent.trim() === "Connection Speed") {                const spanContainer = div.nextElementSibling;                if (!spanContainer) return;                const kbpsSpan = [...spanContainer.querySelectorAll("span")]                    .find(s => s.textContent.includes("Kbps"));                if (!kbpsSpan) return;                const raw = kbpsSpan.textContent;                const match = raw.match(/([\d.]+)\s*Kbps/i);                if (!match) return;                const kbps = parseFloat(match[1]);                const Mbps = kbps / 1000;                // 显示四位小数的 Mbps                kbpsSpan.textContent = `${Mbps.toFixed(4)} Mbps`;            }        });    }    // 高频更新保持同步    setInterval(updateSpeed, 20);})();

闲着没事写的,感兴趣的可以拿去玩玩