From aeb7ccae4fc097fbc59105b8597fd7fdb2680407 Mon Sep 17 00:00:00 2001 From: Xeovalyte Date: Sat, 1 Oct 2022 13:25:56 +0200 Subject: [PATCH] test --- frontend/app.vue | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index 6d1fd9a..adf2312 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -42,13 +42,9 @@ onMounted(() => { auth.value = getAuth() if (process.client) { - if (!window) return; - window.addEventListener('load', () => { - if (!('serviceWorker' in navigator)) { - throw new Error('serviceWorker is not supported in current browser!') - } - navigator.serviceWorker.register('/sw.js') - }) + if ('serviceWorker' in navigator && window.isSecureContext) { + navigator.serviceWorker.register('/sw.js'); + } } onAuthStateChanged(auth.value, async (usr) => {