fix(pwa) fix loading the service worker

We typically use a base URL for static assets using a CDN so loading the worker
from there won't work since it's a different origin. Using a URL relative to the
origin of the page will make it be loaded from the right place.
pull/7951/head
Saúl Ibarra Corretgé 4 years ago committed by Saúl Ibarra Corretgé
parent fbfaed07b2
commit d5b2da02c1
  1. 4
      index.html

@ -25,7 +25,7 @@
if (shouldRegisterWorker) {
navigator.serviceWorker
.register('pwa-worker.js')
.register('/pwa-worker.js')
.then(reg => {
console.log('Service worker registered.', reg);
})
@ -33,7 +33,7 @@
console.log(err);
});
}
})
});
</script>
<script>
// IE11 and earlier can be identified via their user agent and be

Loading…
Cancel
Save