diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2018-01-21 14:45:26 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-21 14:45:26 +0530 |
commit | eeb0df47a0833b33c3b3e252bb51876948f666b3 (patch) | |
tree | a356e0479ae1e822f91dd76a01127ce4e40d2b1b /index.html | |
parent | afc5f905717cf93203ea81f5d680e8aa7e60d519 (diff) |
Update index.html
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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> |