Despite ever expanding web of internet connectivity, no modern web app can expect not to work decently when offline.
Testing offline functionality, though, can be a bit of a bummer for people like me who develop almost exclusively in/for Google Chrome – unlike the old Internet Explorer, it doesn’t have a quick to access ‘Offline Mode’.
Not being a professional developer, I didn’t have extensive tools at my service to test my app in offline mode, and switching WiFi off-on was becoming tiresome. This is the solution I’ve ended up with for offline testing in Chrome:
- Install the Proxy SwitchySharp extension from Chrome Web Store.
In extension’s settings, set up a proxy to a non-existent IP Address, preferably on our local network. We could even set it to localhost/127.0.0.1 if we aren’t running a server on local machine.
- Now every time we need to switch to offline mode, all we have to do is go to the extension’s browser button, and select the local-profile we created.
- When we want to go back on-line, we just select ‘Direct Connection’ or, if we have a corporate proxy, then that.
That’s it! No more toggling WiFi to test offline mode for our web apps.