Chrome extension that comprehensively blocks the Page Visibility API and related detection vectors to prevent websites from detecting 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
- Pages will reload automatically when you change the state
When enabled, the extension blocks all known visibility detection vectors:
- Overrides
Document.prototype.hiddento always returnfalse - Overrides
Document.prototype.visibilityStateto always return'visible' - Blocks
visibilitychangeevent listeners viaaddEventListener - Blocks
document.onvisibilitychangehandler property assignments
- Overrides
document.hasFocus()to always returntrue - Blocks
blurandfocusevent listeners onwindow - Blocks
window.onblurandwindow.onfocushandler property assignments
- All API overrides are applied at the prototype level (
Document.prototype,Window.prototype) to prevent bypass viaObject.getOwnPropertyDescriptor - State communication uses a short, non-descriptive DOM attribute instead of a named
<meta>tag - Blocked listeners are tracked properly so
removeEventListenerbehaves correctly
manifest.json- Extension configuration (Manifest V3)popup.html- Extension popup interfacepopup.js- Popup logic and state managementbackground.js- Background service workerstate_injector.js- Sets blocking state in DOM for the MAIN world script (ISOLATED world)blocker.js- Comprehensive Page Visibility API blocking (MAIN world)test.html- Test suite to verify all blocking vectorsIcon.png- Extension icon
- Websites may use
requestAnimationFrametiming to infer tab backgrounding (extremely difficult to block from an extension) - Page Lifecycle API events (
freeze/resume) are not currently blocked - Blocking may cause pages to continue resource-intensive operations when hidden
- Pages must be reloaded after changing the enabled/disabled state