This script prevents websites from detecting tab switches or window unfocus without breaking website functionality. It emulates constant visibility and focus state, ensuring websites believe you're always active on the tab.
-
Tab Focus Emulation:
Prevents websites from detecting when you switch tabs or unfocus the window. -
Event Blocking:
Blocks events related to visibility and focus such asvisibilitychange
,blur
, andfocus
. -
Full Visibility Simulation:
Overridesdocument.hidden
,document.visibilityState
, anddocument.hasFocus
to always return visible and focused states. -
Safe Functionality Preservation:
The script ensures website functionality remains intact while performing the spoofing.
-
Install a userscript manager:
- Tampermonkey (recommended)
- Greasemonkey
-
Ensure you're using a supported browser:
- Google Chrome
- Mozilla Firefox
Click here to install the userscript.
- Open Tampermonkey dashboard.
- Click on "Create a new script".
- Paste the script code into the editor.
- Save the script.
- Navigate to the website where you want the spoofing functionality.
- Ensure the script is enabled in Tampermonkey.
- Overrides
document.hidden
,document.visibilityState
, anddocument.hasFocus
to make the tab appear always focused. - Blocks
visibilitychange
,blur
,focus
, and related events to prevent detection of tab switching. - Ensures the site remains functional by blocking only relevant events without interfering with the core user experience.
This script is provided for educational purposes only.
- Ensure you comply with the terms of service for the websites where you use it.
- The author is not responsible for misuse or any consequences resulting from the script.
We welcome contributions!
Feel free to open an issue or submit a pull request for improvements or new features.
This project is licensed under the GNU General Public License v3.0.
See the LICENSE file for details.
You can learn more about the GNU General Public License v3.0 here.