taoww:随便写的猴子脚本,youtube的页面代码时不时改,不保证能用多久
(function obs() {
let c = document.querySelector("#ytp-caption-window-container");...回到原帖
大佬,没效果呢
// ==UserScript==
// @name youtubeSmallLowerCase
// @namespace http://tampermonkey.net/
// @version 2024-01-18
// @description try to take over the world!
// @author You
// @match *://*.youtube.*
// @icon https://www.google.com/s2/favicons?sz=64&domain=firefox.net.cn
// @grant none
// ==/UserScript==
(function obs() {
let c = document.querySelector("#ytp-caption-window-container");
if (c == null) {
setTimeout(obs, 100);
return;
}
new MutationObserver(function(mutationList, observer) {
for (const mutation of mutationList) {
for (const node of mutation.addedNodes) {
let s = node.querySelector(".ytp-caption-segment");
if (s !== null) {
s.innerText = s.innerText.toLowerCase();
}
}
}
}).observe(c, { childList: true });
})();