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) => {