Skip to content

Commit fc54175

Browse files
jasonwilliamsJason Williams
authored and
Jason Williams
committed
sw.js should be on the relative path, same as other js/css assets
1 parent 8a92510 commit fc54175

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/theme/book.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,8 @@ function playpen_text(playpen) {
601601
["localhost", "127.0.0.1", ""].indexOf(document.location.hostname) !== -1;
602602

603603
if ("serviceWorker" in navigator && !isLocalhost) {
604-
navigator.serviceWorker
605-
.register(document.location.origin + "/sw.js")
606-
.catch(function(error) {
607-
console.error("Service worker registration failed:", error);
608-
});
604+
navigator.serviceWorker.register("sw.js").catch(function(error) {
605+
console.error("Service worker registration failed:", error);
606+
});
609607
}
610608
})();

0 commit comments

Comments
 (0)