Revert "apparently chrome is a shit browser"

This reverts commit f6f47fcbbe.
This commit is contained in:
2026-07-15 16:32:01 +02:00
parent f6f47fcbbe
commit 8b003c4d57
2 changed files with 7 additions and 33 deletions

View File

@@ -1815,12 +1815,9 @@
const streamUrl = `/api/v2/export/stream?id=${streamId}&filename=${encodeURIComponent(suggestedFileName)}`;
const worker = new Worker(URL.createObjectURL(new Blob([workerCode], { type: 'application/javascript' })));
// The SW must be controlling this page or be active to intercept /api/v2/export/stream.
let sw = navigator.serviceWorker.controller;
if (!sw) {
const reg = await navigator.serviceWorker.getRegistration('/api/v2/export/');
sw = reg ? reg.active : null;
}
// The SW must be controlling this page to intercept /api/v2/export/stream.
// .controller is null after hard refresh — in that case, reload once.
const sw = navigator.serviceWorker.controller;
if (!sw) {
worker.terminate();
exportStatusMsg.textContent = 'Reloading to activate Service Worker...';