Register the Service Worker
This commit is contained in:
parent
794ef99609
commit
ced64485ad
|
@ -27,4 +27,19 @@
|
||||||
<p class="caption">Powered by <a href="https://gohugo.io/" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zzo" rel="noreferrer">Zzo theme</a></p>
|
<p class="caption">Powered by <a href="https://gohugo.io/" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zzo" rel="noreferrer">Zzo theme</a></p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
<script>
|
||||||
|
if('serviceWorker' in navigator) {
|
||||||
|
navigator.serviceWorker
|
||||||
|
.register('/sw.js', { scope: '/' })
|
||||||
|
.then(function(registration) {
|
||||||
|
console.log('Service Worker Registered');
|
||||||
|
});
|
||||||
|
|
||||||
|
navigator.serviceWorker
|
||||||
|
.ready
|
||||||
|
.then(function(registration) {
|
||||||
|
console.log('Service Worker Ready');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue