trying to implement a tricky internet connection detector with JS and got a blocker. The idea is that I use ping/pong method to see that I am online or not. It works fine for On