Service worker fix
Some checks failed
ci / site (push) Has been cancelled
publish-image / publish (push) Has been cancelled

This commit is contained in:
2026-02-10 06:46:29 -05:00
parent 7cb72b2746
commit b61146b145
2 changed files with 2 additions and 8 deletions

View File

@@ -61,7 +61,6 @@ const canonicalUrl = `${siteUrl}${canonicalPath.startsWith("/") ? canonicalPath
// and only when explicitly enabled by env.
import.meta.env.PROD && import.meta.env.PUBLIC_ENABLE_SW === "true" ? (
<script is:inline>
{`
if ("serviceWorker" in navigator) {
// SW requires HTTPS (or localhost). In prod we expect HTTPS.
window.addEventListener("load", () => {
@@ -70,8 +69,8 @@ const canonicalUrl = `${siteUrl}${canonicalPath.startsWith("/") ? canonicalPath
});
});
}
`}
</script>
) : null
}
</head>