🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

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 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
بۈگۈن قاچىلانغىنى
1
جەمئىي قاچىلانغىنى
102
باھا نومۇرى
1 0 0
نەشرى
1.2
قۇرۇلغان ۋاقتى
2025-01-30
يېڭىلانغان ۋاقتى
2025-06-16
Size
2.0 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.