Re: [w3c/ServiceWorker] Turn off a service worker in parts of the website (#1257)

In your service worker's fetch listener:

```js
addEventListener('fetch', event => {
  const url = new URL(event.request.url);

  if (url.origin === location.origin && url.pathname.startsWith('/admin/') {
    // just let the browser do the normal thing:
    return;
  }

  // rest of your service worker logic
});
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1257#issuecomment-356344256

Received on Tuesday, 9 January 2018 16:52:36 UTC