amethyst/assets/quartz/js/sw-register.js
2023-01-01 23:41:14 +00:00

8 lines
222 B
JavaScript

{{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}}
if (navigator.serviceWorker) {
navigator.serviceWorker.register(
"{{ $swJS.RelPermalink }}",
{ scope: "{{ "/" | relURL }}" }
);
}