您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Use this script if you want be able to select youtube captions/subtitles! source: https://stackoverflow.com/questions/40165879/how-make-youtube-subtitles-selectable
当前为
- // ==UserScript==
- // @name make youtube caption selectable
- // @namespace none
- // @version 0.3
- // @description Use this script if you want be able to select youtube captions/subtitles! source: https://stackoverflow.com/questions/40165879/how-make-youtube-subtitles-selectable
- // @author ilya, edr1412
- // @match https://www.youtube.com/*
- // @grant none
- // @license MIT
- // ==/UserScript==
- !function() {
- setInterval(make_subtitles_selectable, 750);
- function make_subtitles_selectable(){
- elem=document.querySelector("div.caption-window");
- if(elem!=null){
- elem.addEventListener("mousedown", function (event) {
- event.stopPropagation();
- }, true);
- elem.setAttribute("draggable", "false");
- elem.style.userSelect="text";
- /* For Safari */
- elem.style.WebkitUserSelect="text";
- elem.style.cursor="text";
- elem.setAttribute("selectable", "true");
- }
- elem=document.querySelector("span.ytp-caption-segment:not([selectable='true']");
- if(elem!=null){
- elem.style.userSelect="text";
- /* For Safari */
- elem.style.WebkitUserSelect="text";
- elem.style.cursor="text";
- elem.setAttribute("selectable", "true");
- }
- elem=document.querySelector("#caption-window-1:not([selectable='true']");
- if(elem!=null){
- elem.addEventListener("mousedown", function (event) {
- event.stopPropagation();
- }, true);
- elem.setAttribute("selectable", "true");
- elem.setAttribute("draggable", "false");
- }
- }
- }()