Add explanation for ./sw.js

This commit is contained in:
Thanh Nguyen 2023-09-24 15:28:37 +07:00
parent 4bc71acc67
commit 9740e5ee12

View File

@ -15,6 +15,8 @@
window.app.authenticated = {% .authenticated %}
if ("serviceWorker" in navigator) {
// we use `./sw.js` instead of `./static/javascripts/sw.js` since the latter would not work with
// `./manifest.json`, and it leads to uninstallable PWA
navigator.serviceWorker.register("./sw.js")
}
</script>