diff options
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> |