fix(service-worker): fixes service worker issue in init-service-worke… (#3378)
This commit is contained in:
parent
0b4c3649e7
commit
55f996cf48
@ -3,7 +3,12 @@
|
|||||||
// modules, so it's perfectly fine to serve this code to any browsers
|
// modules, so it's perfectly fine to serve this code to any browsers
|
||||||
// (older browsers will just ignore it)
|
// (older browsers will just ignore it)
|
||||||
//
|
//
|
||||||
import { Workbox } from 'https://storage.googleapis.com/workbox-cdn/releases/5.0.0-beta.1/workbox-window.prod.mjs';
|
//import { Workbox } from './workbox-window.prod.mjs';
|
||||||
|
// proper initialization
|
||||||
|
if( 'function' === typeof importScripts) {
|
||||||
|
importScripts(
|
||||||
|
'https://storage.googleapis.com/workbox-cdn/releases/6.5.4/workbox-window.prod.mjs'
|
||||||
|
);
|
||||||
|
|
||||||
var supportsServiceWorker = 'serviceWorker' in navigator;
|
var supportsServiceWorker = 'serviceWorker' in navigator;
|
||||||
var isNotLocalDevelopment =
|
var isNotLocalDevelopment =
|
||||||
@ -50,3 +55,5 @@ if (supportsServiceWorker && isNotLocalDevelopment) {
|
|||||||
|
|
||||||
wb.register();
|
wb.register();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user