优酷影院模式

自动转到更宽的 YouTube 屏幕

目前为 2022-01-24 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name:ko 유튜브 극장모드
  3. // @name Youtube Theatermode
  4. // @name:ru Youtube Театральный режим
  5. // @name:jp Youtubeシアターモード
  6. // @name:zh-CN 优酷影院模式
  7. // @name:zh-TW 優酷影院模式
  8.  
  9. // @description:ko 유튜브 화면을 자동으로 꽉 찬 화면으로 바꿉니다.
  10. // @description Turn to wider Youtube screen automatially.
  11. // @description:ru Автоматически переключайтесь на более широкий экран Youtube.
  12. // @description:jp 自動的に広いYouTube画面に移動します
  13. // @description:zh-CN 自动转到更宽的 YouTube 屏幕
  14. // @description:zh-TW 自動轉到更寬的 YouTube 屏幕
  15.  
  16. // @namespace https://ndaesik.tistory.com/
  17. // @version 2022.01.24.21:29
  18. // @author ndaesik
  19. // @icon https://lh3.googleusercontent.com/iLZyxGK7l1343U4E7eAfgKbRWW6qhzCJq-Z92M60JzCMntFyaFF2GUQVRxPhfGcy6qRISLjHv4fX1vtq0TZkZMAzBjM
  20. // @match https://www.youtube.com/*
  21. // ==/UserScript==
  22. var searchResultsDarkMo = `
  23. [dark] .gstl_50.sbdd_a * {background-color:#232323!important; border-color:#282828!important}
  24. [dark] .gsfs,[dark] .sbpqs_a{color:#FFF!important}`
  25. var hideSearchbar = `
  26. ytd-app:not([guide-persistent-and-visible]) ytd-page-manager {margin-top: 0!important;}
  27. ytd-app:not([guide-persistent-and-visible]) :is(
  28. #player-theater-container:empty~#columns #primary,
  29. #player-theater-container:empty~#columns #secondary
  30. ) {padding-top: 56px;}
  31.  
  32. ytd-app:not([guide-persistent-and-visible]) :is(
  33. ytd-masthead,
  34. #masthead-container.ytd-app::after
  35. ) {transform: translateY(-56px); transition: transform .1s .5s ease-out;}
  36.  
  37. ytd-app:not([guide-persistent-and-visible]) :is(
  38. #masthead-container:hover ytd-masthead,
  39. #masthead-container:hover.ytd-app::after
  40. ) {transform: translateY(0px);}
  41.  
  42. ytd-app:not([guide-persistent-and-visible]) [theater] #player.ytd-watch {height: 100vh!important; max-height: 100vh!important;}
  43.  
  44. :is(ytd-watch-flexy[theater],ytd-watch-flexy[fullscreen]) #player-theater-container.ytd-watch-flexy,
  45. ytd-app:not([guide-persistent-and-visible]) [theater] #player video {
  46. width: 100%!important; height: 100vh!important; max-height: 100vh!important; max-width: 100%!important; left: 0!important;
  47. }
  48.  
  49. ytd-app:not([guide-persistent-and-visible]) :is(
  50. .ytp-chrome-top.ytp-share-button-visible, #iv-drawer .iv-drawer-header, #iv-drawer .iv-drawer-content
  51. ) {margin-top: 30px;}
  52.  
  53. ytd-app:not([guide-persistent-and-visible]) [theater] :is(
  54. #iv-drawer .iv-drawer-header, #iv-drawer .iv-drawer-content,
  55. .ytp-chrome-top.ytp-share-button-visible, .ytp-multicam-menu-header, .ytp-multicam-menu-items,
  56. .ytp-playlist-menu-header, .ytp-playlist-menu-items, .ytp-share-panel-close
  57. ) {margin-top: 56px;}
  58.  
  59. ytd-app:not([guide-persistent-and-visible]) .ytp-tooltip.ytp-tooltip-opaque.ytp-bottom {
  60. right: 60px!important; top: 35px!important;}
  61.  
  62. ytd-app:not([guide-persistent-and-visible]) [theater] .ytp-tooltip.ytp-tooltip-opaque.ytp-bottom {
  63. right: 60px!important; top: 60px!important;}`
  64. var SRD = document.createElement("style")
  65. SRD.innerText = searchResultsDarkMo
  66. document.head.appendChild(SRD)
  67. var HSB = document.createElement("style")
  68. HSB.innerText = hideSearchbar
  69. HSB.className = "hideSearchbar"
  70.  
  71. window.addEventListener("yt-navigate-finish", function(e) {
  72. setTimeout(() => {if ((document.querySelector("#ytd-player").offsetWidth + 100) < window.innerWidth) document.querySelector(".ytp-size-button").click()}, 1500)
  73. if (document.URL.indexOf("watch") > -1) document.head.appendChild(HSB)
  74. if (!document.URL.indexOf("watch") > -1 && document.querySelector(".hideSearchbar")) document.querySelector(".hideSearchbar").remove()
  75. })

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址