Re: [ServiceWorker] What is FetchEvent.clientId for navigation requests (#808)

Hi @jakearchibald. Sorry, I was sloppy in my explanations. I'm gonna try to do better.

Any given page can look very different from its original state after a bunch of user clicks. 
Now imagine the user opens the same page twice in different windows, but interacts with the page differently in each wondow.

Now each window has the same url (referrer) and service worker. *But they are not in the same state*. So you may need the service worker to act differently according to the current state of the page he gets the requests from.

For example, you may want to do stuff like:
**if (req.clientID.contentWindow.button1.was.clicked) {  RespondWith("error")  }**

Easy to write, but very hard to do if you don't have the clientID info in the request.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/808#issuecomment-193486073

Received on Monday, 7 March 2016 22:33:35 UTC