Greasy Fork is available in English.

Always on focus

Prevents websites from knowing that you switched tabs or unfocused the window

脚本作者
daijro
今日安装
4
总安装量
12,163
得分
5 1 1
版本
1.5.2
创建日期
2021-07-20
最近更新
2023-10-10
许可证
暂无
应用到
所有站点

Always on focus

Userscript to trick websites into thinking the tab is always on focus


Installation

  1. Download the Tampermonkey browser extension

  2. Click here to install the userscript

  3. Toggle the userscript on/off from the Tampermonkey dashboard


What it does

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 sets window.hasFocus() and window.onFocus() to always true (Ex.)

  • Removes the visibilitychange and blur event listeners (Ex.)

Example:

Here is an example website that changes color when the window isn't focused: