diff options
author | neauoire <[email protected]> | 2019-11-18 16:26:47 -0500 |
---|---|---|
committer | neauoire <[email protected]> | 2019-11-18 16:26:47 -0500 |
commit | 050092c332f2676b01e696cd413821af38709f70 (patch) | |
tree | 01a6148d64bb121ca6f956507cd925cb6a215921 /index.html | |
parent | 7b10b04b3e8b665afebd954d4a9b0c19f50cc1e7 (diff) | |
download | Orca-050092c332f2676b01e696cd413821af38709f70.tar.gz Orca-050092c332f2676b01e696cd413821af38709f70.zip |
Added check against protocole for PWA
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -42,11 +42,9 @@ client.start() }) - if ('serviceWorker' in navigator) { - try { - navigator.serviceWorker.register('sw.js'); - } catch ( error ) { - } + // Register PWA Service Worker + if (location.protocol.substr(0,4) !== ('file') && 'serviceWorker' in navigator) { + try { navigator.serviceWorker.register('sw.js') } catch (err) { console.warn(err) } } </script> </body> |