dispatch/client/js/sw.js

18 lines
463 B
JavaScript
Raw Permalink Normal View History

2020-04-30 05:54:30 +00:00
import { skipWaiting, clientsClaim } from 'workbox-core';
import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching';
import { NavigationRoute, registerRoute } from 'workbox-routing';
2018-11-06 10:13:32 +00:00
2020-04-30 05:54:30 +00:00
skipWaiting();
clientsClaim();
precacheAndRoute(self.__WB_MANIFEST, {
2018-11-06 10:13:32 +00:00
ignoreUrlParametersMatching: [/.*/]
});
2020-04-30 05:54:30 +00:00
const handler = createHandlerBoundToURL('/');
2020-05-17 01:55:46 +00:00
registerRoute(
new NavigationRoute(handler, {
denylist: [new RegExp('/downloads/')]
})
);