Skip to content

Commit 53e231d

Browse files
Hardcode base url in two places
1 parent 759787a commit 53e231d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/simulator.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ declare global {
1818
function initServiceWorker() {
1919
if ("serviceWorker" in navigator) {
2020
window.addEventListener("load", () => {
21-
navigator.serviceWorker.register("/sw.js", { scope: "/" }).then(
22-
function (_registration) {
23-
console.log("Simulator ServiceWorker registration successful");
24-
},
25-
function (err) {
26-
console.log("Simulator ServiceWorker registration failed: ", err);
27-
}
28-
);
21+
navigator.serviceWorker
22+
// TODO: base url is required here. Hardcode for testing purposes.
23+
.register("service-worker/sw.js", { scope: "/service-worker/" })
24+
.then(
25+
function (_registration) {
26+
console.log("Simulator ServiceWorker registration successful");
27+
},
28+
function (err) {
29+
console.log("Simulator ServiceWorker registration failed: ", err);
30+
}
31+
);
2932
});
3033
}
3134
}

0 commit comments

Comments
 (0)