Auto PiP on Tab Switch

Automatically enable Picture-in-Picture mode for videos when switching tabs

作者
FerNikoMF
今日安裝
0
安裝總數
25
評價
0 0 0
版本
1.1
建立日期
2025-01-30
更新日期
2025-01-30
尺寸
1.7 KB
授權條款
MIT
腳本執行於
所有網站

Auto PiP on Tab Switch

This script automatically enables Picture-in-Picture (PiP) mode for videos when you switch to another tab. When you return to the tab with the video, PiP is disabled.

It works on most video platforms like YouTube, Twitch, VK, Twitter, and other websites that use the <video> element. This allows you to continue watching videos in a small window that stays on top of other apps or tabs, without interrupting your viewing experience.

How it works:

  • The script listens for visibility changes on the tab (when you switch to another tab or return to the video tab).
  • When the tab becomes hidden (you switch away), the script triggers PiP for the first available video on the page.
  • When you come back to the tab with the video, PiP is automatically turned off.

Installation Instructions:

  1. Install Tampermonkey (or Greasemonkey for Firefox).
  2. The script will start working automatically on all supported websites.

Supported Websites:

  • YouTube
  • Twitch
  • Twitter
  • VK
  • And any other site using the <video> element.

Requirements:

  • Tampermonkey or Greasemonkey extension version 4.0 or later.
  • Works on Chrome, Edge, Firefox, and other browsers supporting user scripts.

Known Issues:

  • Some websites might block PiP on their video players, in which case the script may not work.
  • Make sure you're using the latest version of your browser for optimal performance.

Changelog:

  • v1.0: Initial release with support for auto Picture-in-Picture when switching tabs.
  • v1.1: add icon.