YouTube - Always Theater Mode

Set the default viewing mode to Theater Mode.

当前为 2015-06-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name YouTube - Always Theater Mode
  3. // @author r-a-y
  4. // @namespace r-a-y/youtube/theater
  5. // @description Set the default viewing mode to Theater Mode.
  6. // @include http://www.youtube.com/watch*
  7. // @include https://www.youtube.com/watch*
  8. // @version 1.1
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. document.getElementById('page').className = "watch watch-stage-mode";
  13. document.getElementById('player').className = "content-alignment watch-medium";
  14. document.getElementById('watch7-container').className = "watch-wide";
  15.  
  16. var playlist = document.getElementById('watch-appbar-playlist');
  17. if (playlist) {
  18. playlist.setAttribute('style', 'top:520px');
  19. }
  20.  
  21. var video = document.getElementsByTagName("VIDEO")[0];
  22. if (video) {
  23. video.setAttribute('style', 'width:100%; height:100%;');
  24. document.getElementsByClassName('html5-video-content')[0].setAttribute('style', 'width:100%; height:100%;');
  25.  
  26. // Progress Bar resizing doesn't work due to YouTube's JS dynamically changing the width to 640px all the time
  27. //document.getElementsByClassName('html5-progress-bar')[0].setAttribute('style', 'width:100% !important');
  28. }