aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2018-01-21 14:45:26 +0530
committerGitHub <noreply@github.com>2018-01-21 14:45:26 +0530
commiteeb0df47a0833b33c3b3e252bb51876948f666b3 (patch)
treea356e0479ae1e822f91dd76a01127ce4e40d2b1b
parentafc5f905717cf93203ea81f5d680e8aa7e60d519 (diff)
Update 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>