Issues (14)

pwabuilder-sw-register.js (3 issues)

1
//This is the service worker with the Cache-first network
2
3
//Add this below content to your HTML page, or add the js file to your page at the very top to register service worker
4
if (navigator.serviceWorker.controller) {
0 ignored issues
show
The variable navigator seems to be never declared. If this is a global, consider adding a /** global: navigator */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
5
  console.log('[PWA Builder] active service worker found, no need to register')
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
6
} else {
7
8
//Register the ServiceWorker
9
  navigator.serviceWorker.register('pwabuilder-sw.js', {
10
    scope: './'
11
  }).then(function(reg) {
12
    console.log('Service worker has been registered for scope:'+ reg.scope);
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
13
  });
14
}