1
0
mirror of synced 2024-11-24 07:40:17 +01:00

web: Added alert when running in Firefox private mode

This commit is contained in:
WerWolv 2023-10-04 13:41:45 +02:00
parent a06752b349
commit 6c773c0135

View File

@ -50,6 +50,10 @@ if(typeof window === 'undefined') {
(async function() { (async function() {
if(window.crossOriginIsolated !== false) return; if(window.crossOriginIsolated !== false) return;
if (!('serviceWorker' in navigator)) {
alert("Your browser doesn't support service workers.\nIf you're using Firefox, you need to not be in a private window.")
}
let registration = await navigator.serviceWorker.register(window.document.currentScript.src).catch(e => console.error("COOP/COEP Service Worker failed to register:", e)); let registration = await navigator.serviceWorker.register(window.document.currentScript.src).catch(e => console.error("COOP/COEP Service Worker failed to register:", e));
if(registration) { if(registration) {
console.log("COOP/COEP Service Worker registered", registration.scope); console.log("COOP/COEP Service Worker registered", registration.scope);