YouTube Theater Fill + Volume OSD - v3.8.6

Stability-first build for Brave: prefer native theater toggle + fill viewport height with clean letterboxing.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者
Left234
今日安裝
0
安裝總數
71
評價
1 0 0
版本
3.8.6
建立日期
2025-11-02
更新日期
2026-02-14
尺寸
14.1 KB
授權條款
MIT
腳本執行於


YouTube Theater Fill in action

Theater mode fully expanded - no black bars, no wasted space.


Tested primarily on Brave (Chromium-based).
Also works on Chrome and Firefox.


Features:

  • Automatically enables Theater mode when opening any YouTube video (AUTO_THEATER can disable this)
  • Expands the player to use the entire viewport height - no top/bottom margins
  • Smart masthead handling to avoid header overlap (can be disabled if your CSS already hides it)
  • Scrolls to top when entering a video, keeping the player clean and centered
  • Global volume hotkeys:
    / adjust volume from anywhere on the page,
    using YouTube’s native player for proper slider sync and persistence
  • Shift + ↑↓ = 10% steps, M toggles mute
  • Includes a clean on-screen volume overlay - no layout shift, no UI bloat

No buttons. No UI. No bloat. Just a better layout with seamless control.

To exit Theater mode, press T or click the standard Theater toggle.


How it works:

  • Automatic Theater mode:
    The script triggers Theater mode the moment you're on a /watch page - even before YouTube finishes rendering.
    It also sets the internal Theater preference key in localStorage for consistency across reloads.
  • Full-height smart scaling:
    The player resizes to fill the entire vertical space below the header using modern viewport units (dvh, svh),
    falling back to 100vh if needed. This ensures compatibility across devices, window sizes, and UI updates.
  • Volume control from anywhere:
    No need to focus the player - the script listens globally.
    and adjust volume via YouTube’s native player,
    ensuring the slider updates and volume persists as YouTube intends.
    Shift increases the step size.
    Press M to mute/unmute. A subtle OSD confirms changes without interrupting playback.
  • Header height calculation:
    By default, the script subtracts the height of YouTube’s sticky header to avoid overlap.
    This is dynamically measured and applied on resize.
    If you’re using CSS mods (like YouTube Live Borderless), you can disable this via USE_HEADER_OFFSET.
  • Fullscreen header suppression:
    Prevents visual glitches (e.g. floating bars or layout compression) when switching into fullscreen while in Theater mode.
    The script temporarily hides the header, then restores it when you exit fullscreen.
  • SPA compatibility:
    YouTube is a single-page app - the script listens for internal route changes (yt-navigate) and reapplies itself automatically.
    No reloads needed. No polling hacks.
  • Watch pages only:
    The script runs only on standard /watch URLs.
    It ignores Shorts, YouTube Music, channels, search pages, and embeds.


Optional toggles for power users:

You can configure three options directly in the code (near the top):

  • FILL_ENABLED - disables the fill layout entirely (fallback to default Theater)
  • USE_HEADER_OFFSET - disables header subtraction (useful if your setup hides it already)
  • AUTO_THEATER - disables automatic switching to Theater mode (for manual control)

No UI is provided - just flip the switches in code. The rest handles itself.