aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html14
1 files changed, 13 insertions, 1 deletions
diff --git a/index.html b/index.html
index bc673e8..4dfe1dd 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,19 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<link rel="manifest" href="manifest.json" />
<meta name="theme-color" content="#373B44">
-<script src="./sw.js"></script>
+<script>
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', function() {
+ navigator.serviceWorker.register('/sw.js').then(function(registration) {
+ // Registration was successful
+ console.log('ServiceWorker registration successful with scope: ', registration.scope);
+ }, function(err) {
+ // registration failed :(
+ console.log('ServiceWorker registration failed: ', err);
+ });
+ });
+}
+ </script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-108635191-1"></script>
<script>