Chrome extension that completely prevents websites from detecting tab switches, page leaves, or window focus changes.
Some websites use various JavaScript APIs to detect whether the user has switched tabs, left the page, or moved the browser window out of focus. Anti-Tab-Detect blocks all known detection methods and makes websites believe the user is always active on the page.
| # | Method | Description |
|---|---|---|
| 1 | Page Visibility API | document.visibilityState → "visible", document.hidden → false |
| 2 | Event Listeners | visibilitychange, blur, focus, focusin, focusout, pagehide, pageshow, mouseenter, mouseleave, mouseover, mouseout |
| 3 | Inline Handlers | window.onblur, window.onfocus, document.onvisibilitychange etc. setters are disabled |
| 4 | document.hasFocus() | Always returns true |
| 5 | rAF + Time Consistency | requestAnimationFrame, performance.now(), Date.now() — consistent fake timeline |
| 6 | IntersectionObserver | Always reports isIntersecting: true, intersectionRatio: 1 |
| 7 | Web Audio API | AudioContext.state → "running", statechange event silenced |
| 8 | Idle Detection API | IdleDetector.userState → "active", screenState → "unlocked" |
- Clone or download this repository:
git clone https://github.com/Adilnasceng/anti-tab-detect.git
- Open
chrome://extensionsin Chrome - Enable Developer mode (top right)
- Click "Load unpacked"
- Select the
anti-tab-detectfolder
- The extension is enabled by default when installed
- Click the extension icon in the toolbar to open the popup
- Use the toggle button to enable/disable
- Icon turns green when active, red when disabled
- State changes apply to newly opened tabs
Active → Blocking all detection methods
Inactive → Websites can detect normally
You can verify the extension is working using this online test tool:
https://webbrowsertools.com/test-always-active/
This site tests multiple tab detection methods. With the extension enabled, all tests should report that the tab is always active.
You can also verify manually via DevTools Console (F12):
document.visibilityState // → "visible"
document.hidden // → false
document.hasFocus() // → trueYou should see a [Anti-Tab-Detect] Aktif log in the console.
anti-tab-detect/
├── manifest.json # Manifest V3 configuration
├── content.js # Main override script (MAIN world)
├── background.js # Service worker — dynamic script registration & icon management
├── popup.html # Popup UI
├── popup.js # Toggle control
├── icons/
│ ├── icon-on-16.png # Active icon (green) — 16x16
│ ├── icon-on-48.png # Active icon (green) — 48x48
│ ├── icon-on-128.png # Active icon (green) — 128x128
│ ├── icon-off-16.png # Inactive icon (red) — 16x16
│ ├── icon-off-48.png # Inactive icon (red) — 48x48
│ └── icon-off-128.png# Inactive icon (red) — 128x128
├── LICENSE
└── README.md
- Manifest V3 format, compliant with modern Chrome standards
- Dynamic content script registration via
chrome.scripting.registerContentScripts— controllable with toggle - Content script runs in
"world": "MAIN"(page's JS context, not isolated) "run_at": "document_start"ensures it loads before the page's own JavaScript- Overrides
EventTarget.prototype.addEventListenerto work across all elements performance.now(),Date.now(), andrequestAnimationFrametimestamps are cross-consistent — defeats advanced timing analysis- Active/inactive state persisted via
chrome.storage.local