register service worker at relative scope

Co-Authored-By: NIan Reinhart Geiser <geiseri@geekcentral.pub>
上级 a2ad3d4f
......@@ -29,7 +29,7 @@
if ("serviceWorker" in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener("load", () => {
navigator.serviceWorker.register("/service-worker.js");
navigator.serviceWorker.register('service-worker.js', {scope: './'});
});
}
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册