This commit is contained in:
Przemek Wiech
2019-07-09 00:35:28 +02:00
parent 34047f63f9
commit fd82df47e5
21 changed files with 466 additions and 459 deletions

View File

@@ -11,13 +11,19 @@
* See https://goo.gl/2aRDsh
*/
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/topola-viewer/precache-manifest.66d8df4499b193362e166a516cfd5aaf.js"
"/topola-viewer/precache-manifest.4ea4a9f80593c895a39c979b55761855.js"
);
workbox.clientsClaim();
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
workbox.core.clientsClaim();
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
@@ -25,10 +31,9 @@ workbox.clientsClaim();
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute("/topola-viewer/index.html", {
workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/topola-viewer/index.html"), {
blacklist: [/^\/_/,/\/[^\/]+\.[^\/]+$/],
});