您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
display the youtube transcript by default
- // ==UserScript==
- // @name Show youtube transcript by default
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description display the youtube transcript by default
- // @author You
- // @match https://www.youtube.com/*
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- setTimeout(() => {
- const transcripts = document.querySelectorAll('[target-id="engagement-panel-searchable-transcript"]');
- if(transcripts.length == 1) {
- const transcript = transcripts[0];
- transcript.setAttribute("visibility", "ENGAGEMENT_PANEL_VISIBILITY_EXPANDED");
- console.log('transcript should show up now...');
- }
- }, "3000"); // wait for 3 seconds (hopefully sufficient for all the necessary elements to load) - adjust this based on your internet speed
- })();