nit:

```js
return (navigator && 'onLine' in navigator) ? !navigator.onLine : true;
```