aboutsummaryrefslogtreecommitdiff
path: root/assets/sw-register.js
blob: 0b71f03d329ddd88f3d10619b04e620c816db14d (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 }}" }
  );
}