I have come with another interesting scenario which might help people to detect wifi status of your machine. This is a great feature that helps to work applications/pages in offline. mode.
Below is a short video demonstrating it
The code can be seen/directly deployed to any org through this link Detect Wifi Status Code
Happy Coding :)