Instagram Background Play
August 10, 2026 ยท View on GitHub
Instagram Background Play
Keep reels and videos playing when you switch tabs. No more frozen picture-in-picture.
Overview
Instagram on the web pauses whatever you are watching the instant you switch to another tab or window. If your browser has automatic picture-in-picture (like Arc or Chrome's Auto-PiP), you get a frozen preview instead of a playing video.
This is not a bug on Instagram's side, it is deliberate. The page watches for the tab going hidden and pauses playback on purpose.
This user script stops that. Videos and reels keep playing when you switch away, and picture-in-picture stays live.
How it works
Instagram detects you leaving through three channels, and the script defuses each one:
- Page Visibility API spoofing:
document.visibilityStatealways reportsvisibleanddocument.hiddenalways reportsfalse, so polling never notices you left. - Event interception:
visibilitychange,blur,focusout,pagehideand friends are captured at the window level before Instagram's listeners can react. - Pause call filtering: any programmatic
pause()fired while the tab is genuinely backgrounded is dropped. Your own pauses still work normally, whether you click the video or use picture-in-picture controls.
No data is collected, nothing leaves your browser, and the script only runs on instagram.com.
Installation
Step 1: Install a user script manager
| Browser | Manager |
|---|---|
| Chrome / Arc / Edge / Brave / Opera | Tampermonkey or Violentmonkey |
| Firefox | Tampermonkey or Violentmonkey |
| Safari | Userscripts |
Important
On Chromium-based browsers (Chrome, Arc, Edge, Brave), Tampermonkey needs the Allow User Scripts toggle (or Developer mode on older versions) enabled on the extensions page, otherwise scripts silently never run. See the Tampermonkey FAQ.
Step 2: Install the script
One-click (recommended):
Manual: click this link and your script manager will prompt you to install:
Updates are automatic either way. The script declares @updateURL, so your manager checks this repository for new versions on its own.
Usage
There is nothing to configure. Open Instagram, play a reel or video, switch tabs. It keeps playing.
Pairs well with automatic picture-in-picture:
- Arc: built in, kicks in on tab switch automatically
- Chrome: enable Auto-PiP in
Settings > Site settings > Additional permissions > Automatic picture-in-picture
Caveats
- Instagram believes the tab is always active. If you leave a DM conversation open in a backgrounded tab, read receipts may fire while you are away.
- The script is intentionally scoped to
instagram.comonly. Sites legitimately use the visibility API to save battery, so a blanket override for every site is a bad idea.
Contributing
Issues and pull requests are welcome. If Instagram ships a change that breaks the script, please open an issue with your browser and script manager versions.