Is there a way, particularly in Electron, to detect whether a device can actively connect to the internet, or better yet can connect reliably?
The documentation recommends using
navigator.onLine, however the way Chrom(e/ium) implements this, it only checks that the machine is connected to some form of LAN. This means that given
false, the user is definitely offline, but doesn’t guarantee that there is an internet connection on
true. This becomes apparent when turning on throttling in DevTools ( I have it set to “Offline”) which is certainly a lot easier than pulling the cable out of my machine every time I want to check offline behaviour.
I can work around this, but if there’s something baked in, that can do it more reliably, that would be ace.