1
0
mirror of synced 2024-09-24 11:38:26 +02: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() {
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));
if(registration) {
console.log("COOP/COEP Service Worker registered", registration.scope);