Skip to content

YouTube Immersive Player

Choose a tag to compare

@aste2d aste2d released this 18 Oct 04:10
· 53 commits to main since this release
72e262a

YouTube Immersive Player v1.48

Release date: 2025-10-18

Changelog (since v1.45)

Added

  • Centralized CONFIG (feature toggles). Behavior is now user-configurable via flags:
    • ENABLE_INLINE_RECS – immersive right panel (default ON)
    • ALLOW_RIGHT_ON_NORMAL – show right panel in normal mode (ON)
    • TOGGLE_WITH_MMB_ON_VIDEO – middle-click video to toggle panel (ON)
    • TOGGLE_WITH_V_KEY – press V to toggle panel (ON)
    • AUTO_HIDE_SECONDARY_ON_LEAVE – auto-collapse on mouse leave (ON)
    • KEEP_SECONDARY_WHEN_OVER_POPUP – do not collapse when moving into popup menus (ON)
    • HIDE_PLAY_PAUSE_BEZEL – hide the large Play/Pause bezel (ON)
    • HIDE_ALL_BEZELS – hide all bezels (OFF)
    • FIX_POPUP_MENU_ON_TOP – raise popup z-index above the right panel (ON)
  • Targeted bezel suppression (Play/Pause only) using aria-label matching in English and Chinese, with fallbacks.

Changed

  • Restructured comments and code sections for clarity (styles, masthead height, popup detection, interactions, init, observers).
  • CSS is now assembled from flags; STYLE_ID bumped to avoid stale style injections.
  • Defaults preserve v1.45 behavior; no new shortcuts.

Fixed

  • Three-dot menu being covered by the right panel. Popup containers (ytd-popup-container, tp-yt-iron-dropdown, ytd-menu-popup-renderer) now render above #secondary.
  • Large Play/Pause icon flashing on spacebar/left-click. Hidden by default via HIDE_PLAY_PAUSE_BEZEL.
  • Right panel collapsing when moving the cursor from #secondary into the menu. The panel now stays open when entering popup/menu areas (e.g., #contentWrapper) using event.composedPath() and ancestor checks.

How to configure (English)

Where: open the installed userscript in your userscript manager (Tampermonkey → Dashboard → click the script name).
At the top of the file you’ll find a centralized CONFIG block.

How: change true / false, then Save. No new shortcuts are added; defaults preserve v1.45 behavior.

const CONFIG = {
  ENABLE_INLINE_RECS: true,            // immersive right panel
  ALLOW_RIGHT_ON_NORMAL: true,         // show panel in normal mode
  TOGGLE_WITH_MMB_ON_VIDEO: true,      // middle-click video toggles panel
  TOGGLE_WITH_V_KEY: true,             // press V toggles panel

  AUTO_HIDE_SECONDARY_ON_LEAVE: true,  // auto-collapse when leaving the panel
  KEEP_SECONDARY_WHEN_OVER_POPUP: true,// don't collapse when entering popup menus

  HIDE_PLAY_PAUSE_BEZEL: true,         // hide large Play/Pause bezel
  HIDE_ALL_BEZELS: false,              // hide all bezels (aggressive)

  FIX_POPUP_MENU_ON_TOP: true          // raise popup z-index above the panel
};

Examples:

  • Keep panel open while using the three-dot menu: keep KEEP_SECONDARY_WHEN_OVER_POPUP: true.
  • Disable auto-collapse completely: set AUTO_HIDE_SECONDARY_ON_LEAVE: false.
  • Hide every overlay icon, not just Play/Pause: set HIDE_ALL_BEZELS: true.
  • If another extension manages z-index: set FIX_POPUP_MENU_ON_TOP: false.

如何进行设置(简体中文)

位置:在用户脚本管理器中打开脚本(Tampermonkey → 控制面板 → 点击脚本名称)。
在文件顶部可以看到集中式的 CONFIG 开关区。

方式:将 true / false 改为你需要的值,然后保存。不会新增快捷键;默认行为与 v1.45 保持一致。

const CONFIG = {
  ENABLE_INLINE_RECS: true,            // 启用沉浸式右侧推荐栏
  ALLOW_RIGHT_ON_NORMAL: true,         // 普通模式显示右栏
  TOGGLE_WITH_MMB_ON_VIDEO: true,      // 中键点击视频切换右栏
  TOGGLE_WITH_V_KEY: true,             // 按 V 切换右栏

  AUTO_HIDE_SECONDARY_ON_LEAVE: true,  // 鼠标移出右栏自动折叠
  KEEP_SECONDARY_WHEN_OVER_POPUP: true,// 移向弹出菜单时不折叠

  HIDE_PLAY_PAUSE_BEZEL: true,         // 隐藏“播放/暂停”大图标
  HIDE_ALL_BEZELS: false,              // 隐藏所有 bezel(更激进)

  FIX_POPUP_MENU_ON_TOP: true          // 提升弹层层级到右栏之上
};

常见场景:

  • 操作“三点更多”菜单时不让右栏收起:保持 KEEP_SECONDARY_WHEN_OVER_POPUP: true
  • 完全关闭自动折叠:将 AUTO_HIDE_SECONDARY_ON_LEAVE 设为 false
  • 不只屏蔽播放/暂停,而是全部提示:将 HIDE_ALL_BEZELS 设为 true
  • 若由其他扩展控制层级:将 FIX_POPUP_MENU_ON_TOP 设为 false

設定方法(日本語)

場所:ユーザースクリプトマネージャでスクリプトを開く(Tampermonkey → ダッシュボード → スクリプト名)。
ファイル先頭に CONFIG セクションがあります。

方法:true / false を必要に応じて変更し、保存します。新しいショートカットは追加されません。既定値は v1.45 の挙動を維持します。

const CONFIG = {
  ENABLE_INLINE_RECS: true,            // 右側の没入型パネルを有効化
  ALLOW_RIGHT_ON_NORMAL: true,         // 通常モードで右パネルを表示
  TOGGLE_WITH_MMB_ON_VIDEO: true,      // 動画の中クリックで切替
  TOGGLE_WITH_V_KEY: true,             // V キーで切替

  AUTO_HIDE_SECONDARY_ON_LEAVE: true,  // パネルから離れたら自動で折りたたみ
  KEEP_SECONDARY_WHEN_OVER_POPUP: true,// ポップアップに入る場合は折りたたまない

  HIDE_PLAY_PAUSE_BEZEL: true,         // 大きい再生/一時停止ベゼルを非表示
  HIDE_ALL_BEZELS: false,              // すべてのベゼルを非表示(強力)

  FIX_POPUP_MENU_ON_TOP: true          // ポップアップを右パネルより前面に
};

よくある調整:

  • 三点メニュー操作中に右パネルを閉じない:KEEP_SECONDARY_WHEN_OVER_POPUP: true のまま。
  • 自動折りたたみを無効化:AUTO_HIDE_SECONDARY_ON_LEAVE: false
  • 再生/一時停止だけでなく全オーバーレイを消す:HIDE_ALL_BEZELS: true
  • 別の拡張が重なり順を管理する場合:FIX_POPUP_MENU_ON_TOP: false