aboutsummaryrefslogtreecommitdiff
path: root/assets/sw-register.js
blob: b67dbfdea8da74ae44372be8c9b77cd179f52316 (plain)
1
2
3
4
5
6
7
{{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}}
if (navigator.serviceWorker) {
  navigator.serviceWorker.register(
    "{{ $swJS.RelPermalink }}", 
    { scope: "{{ "/" | relURL }}" }
  );
}