Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - views
- - index.pug
- - sw.js
- - public
- - js
- - main.js
- - index.js
- if ('serviceWorker' in navigator) {
- window.addEventListener('load', function() {
- navigator.serviceWorker.register('./sw.js').then(function(registration) {
- // Registration was successful
- console.log('Service Worker registration successful with scope: ', registration.scope);
- // console.log('Service Worker registration successful with scope: ', registration.scope);
- }, function(err) {
- // registration failed :(
- console.log('ServiceWorker registration failed: ', err);
- });
- });
- }
- ServiceWorker registration failed: TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement