mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-08 11:48:26 -04:00
Move some messages to debug level
Former-commit-id: d19ef049ebb65fd19289de6015cdc9094f5ec45e [formerly 1e8e46d810dfc37ceec8657e22cc217dff7d4237] [formerly d6a99a62497ab3e42baed238dd435c9a69a8f022] [formerly 402163dc0f1a11c81170a798b818cccb75d6ecd5 [formerly bdf1ff05498921af503ace94e5b0a9f9d5f91011 [formerly 5537ebab448a7409b80be717c9fdf4499fd3c8e2]]] Former-commit-id: a20c2532f7eace025cb595c673ab28f2fa5c5ef4 [formerly bc23f170221a278a0dcbce9f7ef3bc819defbe97 [formerly ca5de85e2df6d93143507de8afddd627759b611b]] Former-commit-id: 2ce1e4468ad2f6a2ad1ebe1e2f649ba8bff1571e [formerly fc87bbf7b4c883e928d6be294c42552d672d8285] Former-commit-id: 3fd6857c3e09b1e56c6df4a668836eabcaa97ddf
This commit is contained in:
parent
9d6dd78b6e
commit
08d35614ae
@ -173,11 +173,11 @@ function intercept(event) {
|
||||
// DEV: Electron uses the file:// protocol and hacks it to work with SW, but it has CORS issues when using the Fetch API to fetch local files,
|
||||
// so we must bypass it here if we're fetching a local file
|
||||
if (/^file:/i.test(event.request.url) && ! (regexpZIMUrlWithNamespace.test(event.request.url) && /\.zim\w{0,2}\//i.test(event.request.url))) return;
|
||||
console.log('[SW] Service Worker ' + (event.request.method === "GET" ? 'intercepted ' : 'noted ') + event.request.url, event.request.method);
|
||||
console.debug('[SW] Service Worker ' + (event.request.method === "GET" ? 'intercepted ' : 'noted ') + event.request.url, event.request.method);
|
||||
if (event.request.method !== "GET") return;
|
||||
event.respondWith(
|
||||
fromCache(event.request).then(function (response) {
|
||||
console.log('[SW] Supplying ' + event.request.url + ' from CACHE...');
|
||||
console.debug('[SW] Supplying ' + event.request.url + ' from CACHE...');
|
||||
return response;
|
||||
},
|
||||
function () {
|
||||
@ -275,7 +275,7 @@ function intercept(event) {
|
||||
}
|
||||
return response;
|
||||
}).catch(function (error) {
|
||||
console.log("[SW] Network request failed and no cache.", error);
|
||||
console.debug("[SW] Network request failed and no cache.", error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user