優酷影院模式

自動轉到更寬的 YouTube 屏幕

目前為 2021-12-18 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Youtube Theatermode
// @name:ko     유튜브 극장모드
// @name:jp     Youtubeシアターモード
// @name:zh-CN  优酷影院模式
// @name:zh-TW  優酷影院模式

// @description       Turn to wider Youtube screen automatially.
// @description:ko    유튜브 화면을 자동으로 꽉 찬 화면으로 바꿉니다.
// @description:jp    自動的に広いYouTube画面に移動します
// @description:zh-CN 自动转到更宽的 YouTube 屏幕
// @description:zh-TW 自動轉到更寬的 YouTube 屏幕

// @namespace   https://ndaesik.tistory.com/
// @version     2021.12.19.08:33
// @author      ndaesik
// @icon        https://lh3.googleusercontent.com/iLZyxGK7l1343U4E7eAfgKbRWW6qhzCJq-Z92M60JzCMntFyaFF2GUQVRxPhfGcy6qRISLjHv4fX1vtq0TZkZMAzBjM
// @match       https://www.youtube.com/*
// ==/UserScript==

window.addEventListener("yt-navigate-finish", function(e) {
  setTimeout(function() {
      if ((document.querySelector('ytd-player').offsetWidth + 100) < window.innerWidth) document.querySelector('.ytp-size-button').click();
  }, 500)
})
var styles = `
[dark] .gstl_50.sbdd_a * {background-color:#232323!important; border-color:#282828!important}
[dark] .gsfs,[dark] .sbpqs_a{color:#FFF!important}

ytd-app:not([guide-persistent-and-visible]) ytd-page-manager {margin-top: 0!important;}
ytd-app:not([guide-persistent-and-visible]) :is(
  #player-theater-container:empty~#columns #primary,
  #player-theater-container:empty~#columns #secondary
) {padding-top: 56px;}

ytd-app:not([guide-persistent-and-visible]) :is(
  ytd-masthead,
  #masthead-container.ytd-app::after
) {transform: translateY(-56px); transition: transform .1s .5s ease-out;}

ytd-app:not([guide-persistent-and-visible]) :is(
  #masthead-container:hover ytd-masthead,
  #masthead-container:hover.ytd-app::after
) {transform: translateY(0px);}

ytd-app:not([guide-persistent-and-visible]) [theater] #player.ytd-watch {height: 100vh!important; max-height: 100vh!important;}

:is(ytd-watch-flexy[theater],ytd-watch-flexy[fullscreen]) #player-theater-container.ytd-watch-flexy,
ytd-app:not([guide-persistent-and-visible]) [theater] #player video {
  width: 100%!important; height: 100vh!important; max-height: 100vh!important; max-width: 100%!important; left: 0!important;
}

ytd-app:not([guide-persistent-and-visible]) :is(
  .ytp-chrome-top.ytp-share-button-visible, #iv-drawer .iv-drawer-header, #iv-drawer .iv-drawer-content
) {margin-top: 30px;}

ytd-app:not([guide-persistent-and-visible]) [theater] :is(
  #iv-drawer .iv-drawer-header, #iv-drawer .iv-drawer-content,
  .ytp-chrome-top.ytp-share-button-visible, .ytp-multicam-menu-header, .ytp-multicam-menu-items,
  .ytp-playlist-menu-header, .ytp-playlist-menu-items, .ytp-share-panel-close
) {margin-top: 56px;}

ytd-app:not([guide-persistent-and-visible]) .ytp-tooltip.ytp-tooltip-opaque.ytp-bottom {
  right: 60px!important; top: 35px!important;}

ytd-app:not([guide-persistent-and-visible]) [theater] .ytp-tooltip.ytp-tooltip-opaque.ytp-bottom {
  right: 60px!important; top: 60px!important;}`
var styleSheet = document.createElement("style")
styleSheet.type = "text/css"
styleSheet.innerText = styles
document.head.appendChild(styleSheet)