4 ms·
I took a quick look at the spec: > The navigator.onLine attribute must return false if the user agent will not contact the network when the user follows links
by ZoFreX 14y ago
I took a quick look at the spec:
> The navigator.onLine attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail), and must return true otherwise.
So, strictly speaking, if you have a network connection and no internet connectivity (and the browser is not aware of the latter), this should return true - because clicking a link will result in the browser contacting the network.
What would be really interesting to see is how this works with various browsers in Windows, because Windows does test connections for internet connectivity.