Pretty much as is doing here: https://github.com/sindresorhus/notifier-for-github/blob/f1facf697f07bc01a030da358c953e4df0155127/source/background.js#L120
Instead of always running the update function, I think it would be nice to check if navigator.onLine
|
async function update() { |
|
let options, |
just add the following on above if (!navigator.onLine) return; I guess.