Web features explorer

Online status

Widely available
Tags: api

The navigator.onLine property returns a Boolean for whether the browser is connected to some network (though not necessarily the internet). The online and offline events fire when the connection state changes. To learn more, see Navigator: onLine property, Window: offline event, Window: online event, WorkerGlobalScope: offline event, WorkerGlobalScope: online event, WorkerNavigator: onLine property at MDN.

Compatibility (view on caniuse.com)