|
阅读:3180回复:7
有没有扩展将youtube字幕大写改成小写的
那些每个字母都大写的英文字幕看起来眼花费劲
|
|
|
|
1楼#
发布于:2024-01-17 09:50
没遇到过全是大写字母的字幕,给个链接看看。
|
|
|
2楼#
发布于:2024-01-17 09:52
|
|
|
|
3楼#
发布于:2024-01-18 15:17
随便写的猴子脚本,youtube的页面代码时不时改,不保证能用多久
(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 });
})() |
|
|
4楼#
发布于:2024-01-18 20:44
taoww:随便写的猴子脚本,youtube的页面代码时不时改,不保证能用多久大佬,没效果呢 // ==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 });
})(); |
|
|
|
5楼#
发布于:2024-01-19 16:34
viewtheard:大佬,没效果呢你把匹配目标写成*://*.youtube.*,根本不会生效啊。你在youtube上点tampermonkey的图标应该会告诉你脚本根本没有启用 后面的代码也稍微改了下,支持那种逐字出现的动态听译字幕了 // ==UserScript==
// @name youtubeSmallLowerCase
// @namespace http://tampermonkey.net/
// @version 2024-01-18
// @description try to take over the world!
// @author You
// @match *://*.youtube.com/*
// @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) {
if (node.nodeType === 3) {
node.textContent = node.textContent.toLowerCase();
}
}
}
}).observe(c, { childList: true, subtree: true });
})(); |
|
|
6楼#
发布于:2024-01-20 06:17
|
|
|
|
7楼#
发布于:2024-02-22 11:46
@-moz-document domain("www.youtube.com") {
.captions-text {text-transform: lowercase !important;}
}css即可实现,很奇怪的是,改为capitalize,是没有效果的。capitalize的效果是每个单词首字母大写,其他小写。 |
|
,建议如果可以再加个条件判断下如果是全大写字幕再强制转换(如整段字幕第一句开头第二个单词为大写),因为有些是姓名,地名,缩写的大小写正常句子不需要转换