I am writing an Electron app and use the Firebase SDK. I am looking for an event or boolean that indicates if the machine is "online".
After I disconnect my development machine from the internet I receive exceptions every few seconds with net::ERR_INTERNET_DISCONNECTED
in the console. This means the internals of Firebase are aware that there is no internet connection available. Can I somehow subscribe to this?
For clarification, no user API call of the Firebase SDK raises an exception, they are console output only.
Potential workarounds
The web API defines the window:online and window:offline event but they are both not trustworthy as they might return incorrect values when VPNs or VMs are installed.
There is a second alternative to ping my website every n-seconds, but I don't want to let thousands of machines do that just to see if their clients are online.