Created
January 26, 2022 08:42
-
-
Save unrealapex/67ebed84abcf6bcb88fa3c5eae4af9d8 to your computer and use it in GitHub Desktop.
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
| // taken from Stack Overflow: https://stackoverflow.com/a/63695199/14111707 | |
| document.addEventListener("visibilitychange", (event) => { | |
| if (document.visibilityState == "visible") { | |
| console.log("tab is active") | |
| } else { | |
| console.log("tab is inactive") | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment