Auto PiP on Tab Switch

Auto Picture-in-Picture when switching tabs (only if video is playing)

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Аўтар
FerNikoMF
Усталяванняў за дзень
0
Усяго ўсталяванняў
96
Рэйтынг
1 0 0
Версія
1.2
Створаны
30.01.2025
Абноўлены
16.06.2025
Памер
2.0 КБ
Ліцэнзія
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.