Userscript to trick websites into thinking the tab is always on focus
-
Download the Tampermonkey browser extension
-
Click here to install the userscript
-
Toggle the userscript on/off from the Tampermonkey dashboard
Always on focus is a lightweight userscript that prevents websites from knowing that you switched tabs or unfocused the window. This is a fork of this userscript that adds these:
-
Disables the Page Visibility API
-
Disables the
window.onblur()
event and and setswindow.hasFocus()
andwindow.onFocus()
to always true (Ex.) -
Removes the
visibilitychange
andblur
event listeners (Ex.)
Here is an example website that changes color when the window isn't focused: