Created
May 11, 2026 07:02
-
-
Save Armster15/1742bd6bd93535b073f5c961aa8eda21 to your computer and use it in GitHub Desktop.
Prevent `visibilitychange` from emitting in your browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name No visibilitychange | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2024-06-20 | |
| // @description Prevent `visibilitychange` from emitting in your browser | |
| // @author You | |
| // @match *://*/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| // https://stackoverflow.com/a/46986927/5721784 | |
| window.addEventListener("visibilitychange", function(event) { | |
| event.stopImmediatePropagation(); | |
| }, true); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment