Re: [fetch] Introduce convenience property for request's context (#93)

> * Revealing to the service worker whether something is a navigation. (I think there might be value for other types too, if you have e.g. transpiling going on for images and you don't want to have to inspect the response before setting up that code.)
> * User navigates to an image. No matching cache entry, network fails. I want to serve my "Ooops, not available offline" page
> * Page loads same image as an image. No matching cache entry, network fails. I want to serve a placeholder image.

For this both the `.isNavigation = true` and the `.context = "document"` proposals would work, right? And how we would treat workers wouldn't affect this use case?

> * As a convenient way to influence Accept

This would seem like an argument for treating workers as script, and for treating all image types as a single type, no matter if they are icons, image-set, `<img>` or `<picture>`.

> * the user agent's notion of "priority" for fetches initiated through fetch() and various preloading mechanisms.

Does any of the proposals made so far help with this one? Other than possibly having a very fine-grained "initiator" exposed to script, but that doesn't seem like something that we want to do?

Regarding CSP, I don't see how exposing anything to webpage script is helping here. Am I missing something? Is the proposal that the service worker would somehow take over the responsibility of enforcing CSP?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/93#issuecomment-126793862

Received on Friday, 31 July 2015 19:43:07 UTC