1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import '../_version.js';
- class PrecacheInstallReportPlugin {
- constructor() {
- this.updatedURLs = [];
- this.notUpdatedURLs = [];
- this.handlerWillStart = async ({ request, state, }) => {
-
- if (state) {
- state.originalRequest = request;
- }
- };
- this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {
- if (event.type === 'install') {
- if (state &&
- state.originalRequest &&
- state.originalRequest instanceof Request) {
-
- const url = state.originalRequest.url;
- if (cachedResponse) {
- this.notUpdatedURLs.push(url);
- }
- else {
- this.updatedURLs.push(url);
- }
- }
- }
- return cachedResponse;
- };
- }
- }
- export { PrecacheInstallReportPlugin };
|