# KeepPlaying

> Keeps videos and ads playing when you switch tabs by neutralizing Page Visibility, focus, and lifecycle events

Canonical page: [https://chrome-stats.com/d/keepplaying](https://chrome-stats.com/d/keepplaying)

## Overview

- **ID:** `keepplaying`
- **Platform:** Firefox
- **Type:** Firefox add-on
- **Status:** Available
- **Publisher:** Shakib Bin Kabir
- **Category:** privacy-security,photos-music-videos,tabs
- **Daily users:** 38
- **Weekly downloads:** 9
- **Version:** 3.1.0
- **Last updated:** 2025-10-20
- **First published:** 2025-06-18
- **Size:** 23 KB
- **Data as of:** 2026-09-09
- **Store listing:** [Firefox Add-ons Store](https://addons.mozilla.org/firefox/addon/keepplaying/)
- **Website:** [https://github.com/shakibbinkabir/keepplaying](https://github.com/shakibbinkabir/keepplaying)

## Description

KeepPlaying keeps videos, ads, and other media playing when you switch tabs. Many sites and ad players pause automatically when they detect the tab is hidden or unfocused. KeepPlaying neutralizes those signals so playback continues uninterrupted.

What it does
- Prevents auto-pause when switching tabs on sites like YouTube and players embedded in iframes (e.g., Google Ads SafeFrame)
- Blocks visibility, focus, and certain lifecycle events used to detect tab changes
- Works automatically on all websites at document start
- No permissions required

Key features
- Page Visibility API blocking (visibilitychange, hidden, visibilityState)
- Focus signal blocking (blur, focus, focusin, focusout)
- Lifecycle event blocking (unload, beforeunload, pagehide) to avoid “permissions policy violation” errors
- Deprecated Mutation Events blocking to eliminate console noise on modern sites
- Injects into all frames, including SafeFrames used by Google Ads

How it works (technical)
- Intercepts EventTarget.addEventListener for a curated list of events across visibility, focus, lifecycle, and deprecated mutation categories
- Overrides document.visibilityState/document.hidden (and webkit-prefixed variants) to simulate an always-visible tab
- Overrides document.hasFocus() to always return true
- Runs at document_start; all_frames enabled for iframe/SafeFrame coverage
- No background scripts, no remote code, no data collection

Compatibility
- Firefox (WebExtensions)
- Works on all websites, including iframe-based ad players

Privacy &amp; permissions
- No data collection, telemetry, or analytics
- No permissions requested

Known limitations
- Sites that rely on unload/beforeunload prompts (e.g., “You have unsaved changes”) will not show those prompts while the extension is active.

Changelog highlights (v3.1.0 — 2025-10-20)
- CRITICAL: all_frames enabled to cover iframes/SafeFrames (fixes Google Ads pausing on tab switch)
- CRITICAL: resolves “Permissions policy violation: unload is not allowed in this document”
- Adds blocking for blur/focus events; overrides document.hasFocus()
- Blocks unload, beforeunload, pagehide; clearer event categorization; now blocks 15 event types total

Links
- Source code: <a href="https://prod.outgoing.prod.webservices.mozgcp.net/v1/0d41376e184be2e12dd93119243988154621558984189a06091de623a4e31295/https%3A//github.com/shakibbinkabir/keepplaying" rel="nofollow">https://github.com/shakibbinkabir/keepplaying</a>
- Changelog: <a href="https://prod.outgoing.prod.webservices.mozgcp.net/v1/97ba6ab35c5773e288a46913a9c879cc213d17fc8ca3e3993d350384d5436c7a/https%3A//github.com/shakibbinkabir/keepplaying/blob/main/CHANGELOG.md" rel="nofollow">https://github.com/shakibbinkabir/keepplaying/blob/main/CHANGELOG.md</a>

## Rankings

- #18,302 — Overall
- #29 — keep
- #102 — visibility
- #135 — override
- #151 — event
- #160 — changelog

## Permissions and access

### Content script matches

- `*`

## Safety

- **Risk impact:** Moderate risk impact
- **Risk likelihood:** Moderate risk likelihood

### Analysis details

- Allows access to all websites, posing a significant security risk as it can monitor and modify data from any visited site.
- This extension support email may not be valid

> Some risk analysis details are omitted from this free response. [Upgrade to view the full analysis](https://chrome-stats.com/pricing).

## Similar extensions and apps

- [Keep Video Playing](https://chrome-stats.com/d/keep-video-playing) — 5 users
- [No Pause Playback Free](https://chrome-stats.com/d/no-pause-playback-free) — 75 users, 2.50 / 5
- [Let me Leave](https://chrome-stats.com/d/let-me-leave) — 4 users, 4.00 / 5
- [Play YouTube Video In Background](https://chrome-stats.com/d/play-yt-video-in-background) — 1,642 users, 4.58 / 5
- [Auto Stop Videos on Tab Switch](https://chrome-stats.com/d/auto-stop-videos-on-tab-switch) — 28 users
- [InstaNeverPause](https://chrome-stats.com/d/instaneverpause) — 90 users, 5.00 / 5
- [Video Auto Pause](https://chrome-stats.com/d/video-auto-pause) — 45 users, 4.00 / 5
- [Auto Stop Video on Tab Switch](https://chrome-stats.com/d/auto-stop-video-on-tab-switch) — 28 users
- [Don't Make Me Watch](https://chrome-stats.com/d/don-t-make-me-watch) — 25 users, 1.00 / 5
- [Tab Focus](https://chrome-stats.com/d/focusontab) — 97 users, 5.00 / 5
- [Video Auto-Pause](https://chrome-stats.com/d/video-free-auto-pause) — 53 users, 5.00 / 5
- [Auto Pause Videos on Tab Switch](https://chrome-stats.com/d/pause_videos_on_tab_switch) — 5 users

---

Source: [Chrome-Stats](https://chrome-stats.com/d/keepplaying)
