Chrome extension that blocks the Page Visibility API and related focus/blur detection vectors to reduce websites' ability to detect when the page is hidden or minimized.
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked"
- Select this directory
- Click the extension icon in the Chrome toolbar
- Toggle the "Block API" switch to enable or disable blocking
- Open tabs reload automatically when you change the state
When enabled, the background service worker dynamically registers blocker.js as a document_start MAIN-world content script. When disabled, that dynamic content script is unregistered and tabs are reloaded, so page-modifying overrides are not injected into newly loaded pages.
- Overrides
Document.prototype.hiddento returnfalse - Overrides
Document.prototype.visibilityStateto return'visible' - Overrides Chromium's prefixed
webkitHidden/webkitVisibilityStatealiases when present - Blocks
visibilitychangelisteners ondocumentandwindow - Blocks
document.onvisibilitychangeandwindow.onvisibilitychangehandler property assignments where exposed
- Overrides
document.hasFocus()to returntrue - Blocks
blurandfocusevent listeners onwindow - Blocks
window.onblurandwindow.onfocushandler property assignments
The dynamic content script is registered for all frames with matchOriginAsFallback enabled where supported, improving coverage for data:, blob:, and similar child-frame URLs that inherit origin context.
manifest.json- Extension configuration (Manifest V3)popup.html- Extension popup interfacepopup.js- Popup logic and state managementbackground.js- Dynamic content-script registration and state managementblocker.js- Page Visibility API blocking logic (MAIN world)test.html- Manual test suite to verify common blocking vectorsicon-16.png,icon-48.png,icon-128.png- Extension icons
- Any MAIN-world JavaScript override can be detected by a sufficiently motivated page. This extension reduces common visibility/focus detection but cannot provide perfect anti-fingerprinting.
- Websites may use timing side channels such as
requestAnimationFrame, timers, media playback, networking behavior, or CPU throttling to infer backgrounding. - Some pages may use Page Lifecycle API events (
freeze/resume) or other browser signals not currently blocked. - Existing tabs must reload after changing the enabled/disabled state; tabs that Chrome refuses to reload keep their previous state until manually reloaded.
- Blocking may cause pages to continue resource-intensive operations while hidden.