Your IP : 18.116.90.47


Current Path : /usr/local/mgr5/skins/dragon/
Upload File :
Current File : //usr/local/mgr5/skins/dragon/isp-worker-wrapper.js

// 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');