Web features explorer

Online status

Widely available since 2018-01-29
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.

Learning resources on MDN

Browser support (view on caniuse.com)