X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fmain.ts;h=3fb9b346e29ec91272528f4f43ce108c9260b48e;hb=72c8855574a5b9ebdcd16132a5a8c50b8ba11c9b;hp=4b18d163c446c09f13b4a485e93c1c1fd12f0e1f;hpb=fed951557277a6f783c75909f4cbeb21c4159133;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/main.ts b/client/src/main.ts index 4b18d163c..3fb9b346e 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -20,11 +20,14 @@ const bootstrap = () => platformBrowserDynamic() // .catch(err => console.error('Cannot register service worker.', err)) // } - navigator.serviceWorker.getRegistrations().then(registrations => { - for (const registration of registrations) { - registration.unregister() - } - }) + if (navigator.serviceWorker && typeof navigator.serviceWorker.getRegistrations === 'function') { + navigator.serviceWorker.getRegistrations() + .then(registrations => { + for (const registration of registrations) { + registration.unregister() + } + }) + } return bootstrapModule })