Your IP : 18.116.90.47
// listen to every fetch event
self.addEventListener('fetch', event => {
const req = event.request;
const reqUrl = new URL(req.url);
// ignore every request that is not a resource (html, css, js, etc.)
if (!reqUrl.pathname.startsWith('/manimg/dragon')) {
// prevent handling 'fetch' event in ngsw-worker.js
event.stopImmediatePropagation();
return;
}
if (req.method === 'GET' && req.destination === 'document') {
// only intercept if there was a problem fetching index.html
event.respondWith(
fetch(req).catch(error => {
console.error(
'[onfetch] Failed. Serving cached offline fallback',
error,
);
// return offline page from cache instead
return caches.match('./assets/offline.html');
}),
);
}
});
// use all the magic of the Angular Service Worker
importScripts('./ngsw-worker.js');