fuck chromium! its a shit browser

This commit is contained in:
2026-07-15 16:42:23 +02:00
parent 8b003c4d57
commit 2fa7e01b3a
3 changed files with 47 additions and 14 deletions

View File

@@ -1815,9 +1815,12 @@
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 to intercept /api/v2/export/stream.
// .controller is null after hard refresh — in that case, reload once.
const sw = navigator.serviceWorker.controller;
// 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;
}
if (!sw) {
worker.terminate();
exportStatusMsg.textContent = 'Reloading to activate Service Worker...';