Show youtube transcript by default

display the youtube transcript by default

  1. // ==UserScript==
  2. // @name Show youtube transcript by default
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description display the youtube transcript by default
  6. // @author You
  7. // @match https://www.youtube.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. setTimeout(() => {
  15. const transcripts = document.querySelectorAll('[target-id="engagement-panel-searchable-transcript"]');
  16. if(transcripts.length == 1) {
  17. const transcript = transcripts[0];
  18. transcript.setAttribute("visibility", "ENGAGEMENT_PANEL_VISIBILITY_EXPANDED");
  19. console.log('transcript should show up now...');
  20. }
  21. }, "3000"); // wait for 3 seconds (hopefully sufficient for all the necessary elements to load) - adjust this based on your internet speed
  22. })();