mgrubinger / blog

https://www.grooovinger.com/
MIT License
0 stars 0 forks source link

Detect if the tab is hidden or visible #22

Open mgrubinger opened 1 year ago

mgrubinger commented 1 year ago

date: '2020-10-15' short: using document.hidden

Detect if the document is currently hidden (which means, not active. e.g. user currently has a different tab open)

document.hidden

https://developer.mozilla.org/en-US/docs/Web/API/Document/hidden