how to check if user lost internet connection
Sometimes losing time on the web I noticed some websites have specific ways to deal with a user who has lost his connections. I wonder how. Is there an event that fires when this happens?
10 Replies
MDN Web Docs
Window - Web APIs | MDN
The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window.
When a user loses his internet connection, how much time it takes for this to happen?
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1212116559632277574/Screenshot_2024-02-27-16-17-48-965_com.android.chrome-edit.jpg)
Should be as soon as the OS notices
could take a few seconds. i remember vaguely the browsers are checking the status every x-time
It is a tricky one because it can returns false positivies
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1212120144046858311/Screenshot_2024-02-27-16-30-40-950_com.android.chrome-edit.jpg)
that is navigator.online property, different rom the online/offline events
The online /offline events is based on that property
🤠I can't read
As here says
yup