There was an error while loading. Please reload this page.
1 parent f8ad903 commit b1157beCopy full SHA for b1157be
1 file changed
public/codeblocks.js
@@ -47,10 +47,12 @@
47
"Service workers are unavailable; clangd cannot enable cross-origin isolation",
48
);
49
} else {
50
- var workerUrl = new URL(
51
- serviceWorker || "./coi-serviceworker.js",
52
- script.src,
53
- );
+ // An explicitly configured worker belongs to the host page, so its
+ // relative URL follows normal HTML attribute semantics. The bundled
+ // fallback remains relative to this loader script.
+ var workerUrl = serviceWorker
54
+ ? new URL(serviceWorker, document.baseURI)
55
+ : new URL("./coi-serviceworker.js", script.src);
56
log("Registering isolation service worker at " + workerUrl.href);
57
await navigator.serviceWorker.register(workerUrl, { scope: "./" });
58
await navigator.serviceWorker.ready;
0 commit comments