Offline.check(): Check the current status of the connection.
Offline.state: The current state of the connection 'up' or 'down'
Offline.on(event, handler, context): Bind an event. Events:
function checkOnlineState(){
if (navigator.onLine){
window.location = "https://example.com/";
} else {
alert('нет доступа к сети');
}
}
window.addEventListener('online', checkOnlineState);
checkOnlineState();