A lightweight Chrome extension that prevents websites from detecting tab switches.
Websites detect tab switches through a handful of browser APIs — Page Visibility, focus/blur events, document.hasFocus(), and more. Tab Spoofer intercepts all of them at the earliest injection point (document_start) so the page always believes you're present and focused.
| Method | What sites use it for | Spoof |
|---|---|---|
document.visibilityState |
Check if tab is active | Always returns "visible" |
document.hidden |
Boolean visibility flag | Always returns false |
visibilitychange event |
React to tab switch | Blocked before site handlers run |
window blur |
Detect loss of window focus | Stopped at capture phase |
document mouseleave |
Detect cursor leaving browser | Stopped at capture phase |
focusout |
Detect when no element is focused | Stopped at capture phase |
document.hasFocus() |
Polled focus check | Always returns true |
- Clone or download this repo
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer Mode (toggle, top right)
- Click Load unpacked and select the
tab-spoofer/folder
The extension is now active on all pages. No restart required.
Open index.html or go to Tab Spoofer — Test Page in Chrome after loading the extension. Switch tabs — all counters should stay at zero. Click Run manual checks to verify the spoofed property values directly.
Without the extension, switching tabs immediately triggers the red indicators.
By default the extension runs on all URLs. To limit it to one domain, edit manifest.json:
"matches": ["*://example.com/*"]This extension only bypasses JavaScript-based detection. The following are out of scope:
- Server-side timing — gaps in API calls or heartbeats are visible server-side; no client spoofing can hide them
requestAnimationFramepause detection — rAF stops in background tabs; apps that track frame timing will noticesetIntervaldrift — background tabs throttle timers; some apps detect the drift
tab-spoofer/
├── manifest.json # Manifest V3 extension config
├── spoof.js # Injection script — runs before page JS
└── index.html # Standalone test page
This project is licensed under the MIT License.
Made with ❤️ by Arman Singh