In my Ionic app, I need to perform certain actions based on whether user is offline or online.
I would be using $cordovaNetwork plugin in the app to find the connectivity status. However, during development on my laptop I am looking for an easy way to test the connectivity (without having to deploy on the device).
So, I thought of using navigator.onLine to test offline/online business logic. But even if I switch off wifi on the laptop (there is no LAN cable plugged to the laptop), navigator.onLine still returns true.
Can someone please advice how can I make navigator.onLine return false or any other way to find out whether there is internet connection or not?
EDIT: Browser is Chrome
The service code:
Then in controller (an example):