From d854b2cd3d62647c32324eb0ca472dcab09fd217 Mon Sep 17 00:00:00 2001 From: Tudor-Ovidiu Avram Date: Fri, 16 Oct 2020 12:04:53 +0300 Subject: [PATCH] fix(pwa) remove window.load event handler for pwa registrator --- static/pwa/registrator.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/static/pwa/registrator.js b/static/pwa/registrator.js index 3a0137468..374dc8cc0 100644 --- a/static/pwa/registrator.js +++ b/static/pwa/registrator.js @@ -1,12 +1,10 @@ if ('serviceWorker' in navigator) { - window.addEventListener('load', () => { - navigator.serviceWorker - .register('pwa-worker.js') - .then(reg => { - console.log('Service worker registered.', reg); - }) - .catch(err => { - console.log(err); - }); - }); + navigator.serviceWorker + .register('pwa-worker.js') + .then(reg => { + console.log('Service worker registered.', reg); + }) + .catch(err => { + console.log(err); + }); }