[whatwg] Workers feedback

On Thu, Nov 13, 2008 at 10:17 PM, Jonas Sicking <jonas at sicking.cc> wrote:
> Aaron Boodman wrote:
>> On Thu, Nov 13, 2008 at 8:45 PM, Ian Hickson <ian at hixie.ch> wrote:
>>> On Thu, 13 Nov 2008, Jonas Sicking wrote:
>>>> Actually, i think we should remove the location accessor as well. I
>>>> can't think of a common enough use case that warrants an explicit API.
>>>> You can always transfer the data through postMessage.
>>> I added that one becase Aaron asked for it. Aaron?
>> I think it's useful. Obviously it's not totally necessary.
> What are the use cases? Also note that we can't use it with shared workers
> since they can be connected to several pages from different uris.

It represents the URI of the worker itself, not the URI of the calling page.

In Gears, authors asked us for a location object because they had
applications that could be served from different origins. Also in
Gears, workers can be accessed across origins, so incoming messages
need to be validated that they are from the correct origin. It's more
convenient for a worker to access its own origin through an API the UA
provides than to bake it into the script or send it in the first

Although HTML5 workers don't have the ability to be accessed across
origins, you do have the ability to receive ports that are connected
to other origins, right? So this might still be an issue.

Other than that, I can't think of any specific use cases. It seemed
like a generally useful API to have access to.

- a

Received on Friday, 14 November 2008 08:16:22 UTC