SW still not fixed
This commit is contained in:
@@ -64,10 +64,12 @@ const canonicalUrl = `${siteUrl}${canonicalPath.startsWith("/") ? canonicalPath
|
|||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
// SW requires HTTPS (or localhost). In prod we expect HTTPS.
|
// SW requires HTTPS (or localhost). In prod we expect HTTPS.
|
||||||
window.addEventListener("load", () => {
|
window.addEventListener("load", () => {
|
||||||
navigator.serviceWorker.register("/sw.js", { scope: "/" }).catch((err) => {
|
navigator.serviceWorker
|
||||||
|
.register("/sw.js", { scope: "/", updateViaCache: "none" })
|
||||||
|
.catch((err) => {
|
||||||
// Progressive enhancement; keep failures non-fatal.
|
// Progressive enhancement; keep failures non-fatal.
|
||||||
console.warn("Service worker registration failed", err);
|
console.warn("Service worker registration failed", err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user