navigator.onLine is not a good way to test if the client is connected to the internet in an html5 offline application