On Wed, Dec 10, 2014 at 6:46 PM, Ehsan Akhgari <ehsan.akhg...@gmail.com> wrote: > So I guess my biggest question so far is: what will we gain by adding > another API specifically for connecting to the service worker? Do you think > we can avoid doing that and focus on making XHR/fetch work with cross origin > SWs?
One idea that has been making the rounds in service worker issues is having a message channel associated with a request. So when e.g. <img> does a fetch, we could expose its request as a Request object to the page. But furthermore, we could also offer a way on that object to communicate with the service worker's event that is handling the request, which would allow for adjusting the priority and such, but could also be seen as a low-level explanation of how responses get back to the page. Given that, both API styles discussed here, messaging and fetching, make some sense to me. I'm not sure we necessarily need to be exclusive. The latter is nice in that it integrates well with existing HTTP APIs, the former is nice in that it has a lot more flexibility as you don't need to follow request/response. -- https://annevankesteren.nl/ _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform