Skip to content

armansinghh/tab-spoofer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tab Spoofer

A lightweight Chrome extension that prevents websites from detecting tab switches.

Manifest V3 License: MIT

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.


How it works

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

Install

  1. Clone or download this repo
  2. Open Chrome and navigate to chrome://extensions/
  3. Enable Developer Mode (toggle, top right)
  4. Click Load unpacked and select the tab-spoofer/ folder

The extension is now active on all pages. No restart required.


Test it

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.


Targeting a specific site

By default the extension runs on all URLs. To limit it to one domain, edit manifest.json:

"matches": ["*://example.com/*"]

Limitations

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
  • requestAnimationFrame pause detection — rAF stops in background tabs; apps that track frame timing will notice
  • setInterval drift — background tabs throttle timers; some apps detect the drift

Files

tab-spoofer/
├── manifest.json   # Manifest V3 extension config
├── spoof.js        # Injection script — runs before page JS
└── index.html      # Standalone test page

License

This project is licensed under the MIT License.


Made with ❤️ by Arman Singh

About

Intercepts all JS-based tab-switch detection before the page loads — Page Visibility API, blur/focus events, hasFocus(), and more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors