adding service worker

parent cbe8b09c
...@@ -220,7 +220,13 @@ ...@@ -220,7 +220,13 @@
}; };
async function run() { async function run() {
app.registration = await navigator.serviceWorker.register('/sw.js', {scope: '/'})
.then(async function(sw) {
console.info('ServiceWorker registered: ', sw.scope);
return sw;
});
}; };
app.nextTick = function() { app.nextTick = function() {
......
 importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.3/workbox-sw.js');
\ No newline at end of file
if (workbox) {
console.log(`Yay! Workbox is loaded 🎉`);
workbox.precaching.precacheAndRoute(self.__WB_MANIFEST);
workbox.googleAnalytics.initialize();
} else {
console.log(`Boo! Workbox didn't load 😬`);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment