lbry-desktop/static/pwa/serviceWorker.js

12 lines
378 B
JavaScript
Raw Normal View History

2021-06-02 21:50:47 +02:00
// register service worker
2021-05-25 19:40:48 +02:00
if ('serviceWorker' in navigator) {
2021-06-02 21:50:47 +02:00
navigator.serviceWorker.register('./serviceWorker.js').then(function(reg) {
// reg.scope must be '/' to allow '/' as start url
2021-05-25 19:40:48 +02:00
}).catch(function(err) {
2021-06-01 16:10:39 +02:00
// console.warn('Error whilst registering service worker', err);
2021-05-25 19:40:48 +02:00
});
}
2021-06-02 21:50:47 +02:00
// used to fetch the manifest file
self.addEventListener('fetch', () => {});