您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Youtube字幕单词可以使用选中,方便Mac电脑快速选中翻译单词(Mac触控板手势重按或三指轻点)
当前为
// ==UserScript== // @name:en Set Youtube caption selectable easy to quickly translate word for Mac // @name Youtube字幕单词可以使用选中,方便Mac电脑快速选中翻译单词 // @namespace http://tampermonkey.net/ // @version 1.0 // @description:en Set Youtube caption selectable, make it easy to quickly select and translate word in the caption for Mac // @description Youtube字幕单词可以使用选中,方便Mac电脑快速选中翻译单词(Mac触控板手势重按或三指轻点) // @author You // @match https://www.youtube.com/watch?v=-EogHCFd7w0&ab_channel=LinusTechTips // @icon https://www.google.com/s2/favicons?domain=youtube.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Your code here... /** 检测DOM变动 */ const mutationDiv = document.querySelector('#ytp-caption-window-container'); const observer = new MutationObserver(callback); observer.observe(mutationDiv, { childList: true, // 观察直接子节点 subtree: true, // 及其更低的后代节点 attributes: true, characterData: true }); /** DOM变动的回调函数 */ function callback (mutationRecord) { const spanList = mutationDiv.querySelectorAll('span'); spanList.forEach(el => { el.style.userSelect = 'text'; }); }; })();