A Firefox extension that prevents videos from pausing on YouTube, YouTube Music, and Vimeo when switching apps, tabs, or locking the screen. Also automatically handles "Continue watching?" and similar inactivity dialogs on YouTube and YouTube Music. Designed to work on both Firefox for Android and Firefox Desktop.
- Firefox for Android: Helps maintain background audio playback when switching apps or locking the screen.
- Firefox Desktop: Prevents videos from pausing when switching tabs and stabilizes playback in secondary UI contexts such as the Firefox sidebar or DevTools responsive mode. Verified compatible on Windows; other desktop platforms are not officially tested.
- Auto-Dismiss Idle Prompts: Automatically handles "Continue watching?" and similar inactivity dialogs on YouTube and YouTube Music, and periodically pings the player to help prevent idle timeouts. Enabled by default.
- Active Status Indicator: Automatically detects supported sites and displays a green icon and badge when the helper is active.
- Dark Mode UI: Minimal, dark-themed popup interface for toggling features.
- Optional Keep-Alive: Sends harmless, non-character activity signals designed to reduce inactivity-based pauses.
- Privacy Focused: All logic runs locally. No user data is collected or transmitted.
The easiest way to install is through the official Mozilla Add-ons site. This version is signed and verified.
Useful for development and testing. Temporary add-ons are removed when Firefox restarts.
Before installing on Android or as a permanent desktop add-on, you need to package the extension:
-
Clone or download this repository
-
Create the XPI file:
- Open the extension folder in File Explorer
- Select all files and folders (
manifest.json,background.js,icons/, etc.) - Right-click → Send to → Compressed (zipped) folder
- Rename the resulting
.zipfile to.xpi(e.g.,background-playback-helper.xpi)
Important: Make sure to zip the contents of the folder, not the folder itself. The
manifest.jsonshould be at the root of the archive, not inside a subfolder.
Temporary Installation (any Firefox version):
- Open Firefox and navigate to
about:debugging - Click "This Firefox" in the left sidebar
- Click "Load Temporary Add-on..."
- Navigate to the extension folder and select the
manifest.jsonfile - The extension is now active until Firefox restarts
Permanent Installation (Developer Edition, Nightly, or ESR only):
- Create an XPI file using the steps above
- In Firefox, navigate to
about:config - Search for
xpinstall.signatures.requiredand set it tofalse - Drag the
.xpifile into Firefox, or go toabout:addons→ gear icon → "Install Add-on From File..."
NOTE: Disabling signature requirements only works in Firefox Developer Edition, Nightly, or ESR, not in standard Firefox releases.
NOTE: Firefox Nightly and Beta support installing signed add-ons directly from
.xpifiles. However, this method requires a Mozilla-signed version of the.xpifile downloaded from the Mozilla Add-ons site. To install from the source files in this repo, create an.xpifile and install using a Firefox fork like Iceraven
-
Download the signed
.xpifile to your Android device -
Enable the Debug Menu (first time only):
- Open Firefox Nightly or Beta
- Go to Settings → About Firefox Nightly (or About Firefox Beta)
- Tap the Firefox logo 5 times until you see "Debug menu enabled"
-
Install the add-on:
- Go to Settings → Advanced → Install add-on from file
- Select the
.xpifile from your device - Tap Add when prompted
-
Visibility API Handling: Overrides
document.hiddenanddocument.visibilityStateto prevent supported sites from treating the page as hidden during tab, app, or UI transitions. Original property descriptors are preserved so behavior can be disabled at runtime without reloading. -
Keep-Alive Activity: Periodically dispatches synthetic modifier key events (Shift, Ctrl, Alt) as a keep-alive signal for players that pause after long inactivity. No character input is generated and no user input is intercepted.
-
Auto-Dismiss Dialogs: Periodically calls the site's player activity API (
updateLastActiveTime, when available) and dismisses inactivity prompts such as "Continue watching?" or "Still listening?" This feature only activates on YouTube domains when a media element is present. -
Desktop-Specific Behavior: Stabilizes playback when video sites are loaded in secondary desktop UI contexts such as the Firefox sidebar, addons like Firefox Second Sidebar, and DevTools responsive views, where visibility APIs behave similarly to mobile.
| Permission | Purpose |
|---|---|
storage |
Save user preferences locally |
tabs |
Detect when supported sites are active for badge updates |
This extension does NOT:
- Collect, transmit, or store any user data
- Bypass DRM, subscription restrictions, or platform-enforced limits
- Load external resources or make network requests
- Read or intercept user input
YouTube frequently changes its code, which can occasionally affect the extension. If you encounter issues, try the following debugging steps:
Desktop (Firefox):
- Click the lock/site info icon in the address bar
- Clear all site data for YouTube/YouTube Music (cookies, cache, storage)
- Verify extension options are configured as desired
- Reload the page and sign in again
Android (Firefox for Android):
- Tap the shield icon in the address bar
- Clear cookies and site data for YouTube/YouTube Music
- Verify extension options are configured as desired
- Reload the page and sign in again
If the steps above don't work, please don't rush to leave a negative review! Instead:
- Check if YouTube recently pushed changes (this often affects multiple extensions)
- Try disabling and re-enabling the extension
- Contact us via the support email link on the Mozilla Add-ons page
Distributed under the MIT License. See the LICENSE file for details.
Portions of this project are inspired by or based on concepts from:
- Background-Video-Fix by DarthIF
- video-bg-play by Mozilla