Currently Only Compatible with Chrome and Brave! Edge is Not Supported
This userscript automatically triggers Picture-in-Picture (PiP) mode while watching YouTube and Bilibili videos. It handles tab switching and playback status changes, providing a smooth video-watching experience. Inspired by the Arc browser experience, it was developed with AI assistance. Future maintenance may be sporadic.
🎉 Enjoy the smoothest PiP experience!
- 🔄 PiP mode is automatically triggered during video playback, allowing you to view the video in a floating window while multitasking or browsing other pages.
- ⚡ If you switch tabs, PiP mode will wait for user interaction to activate.
- ❌ When the pause button is clicked, PiP mode will not be triggered, preventing accidental PiP entry.
- 🔄 When you return to the video tab, PiP remains in standby and activates only when the video is clicked.
- 🎬 PiP mode is triggered when the video is clicked, as long as it’s playing.
- 📱 Uses
navigator.mediaSession
API to set "Enter PiP" action, enabling control of PiP via media sessions.
- ✅ Unlike other scripts, this one activates PiP without requiring page interaction.
To ensure the script works correctly, follow these steps:
-
Open Chrome Settings
- Click the "three dots" icon in the upper-right corner and select "Settings".
-
Access Site Settings
- Go to "Privacy and Security" → "Site Settings".
-
Enable Auto PiP Mode
- Under "Permissions," select "Additional Permissions Settings".
- Locate "Automatically enter Picture-in-Picture mode" and allow sites to use this feature automatically.
-
Enable Developer Mode for Extensions
-
Enable Chrome Flags
- Go to
chrome://flags
and enable:Auto picture in picture video heuristics
Auto picture in picture for video playback
- Go to