tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

fetch-intercept-worker.js (288B)


      1 self.addEventListener('fetch', e => {
      2  if (e.request.url.includes('should-intercept')) {
      3    if (e.request.destination === 'document') {
      4      e.respondWith(fetch('./prerendered-page.html'));
      5    } else {
      6      e.respondWith(new Response('intercepted by service worker'));
      7    }
      8  }
      9 });