Service worker fix
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user