Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
littlecranky67
on Dec 15, 2022
|
parent
|
context
|
favorite
| on:
Lesser-known JavaScript APIs
There are other ways to detect if a tab/window is in foreground. One hack is abusing timer slowdown (setInterval() resolution is moved to 1000ms for background tabs, you could compare against system time to detect this).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: