[whatwg] SharedWorkers and the name parameter

Drew Wilson atwilson at google.com
Tue Aug 18 19:53:18 PDT 2009


An alternative would be to make the "name" parameter optional, where
omitting the name would create an unnamed worker that is identified/shared
only by its url.
So pages would only specify the name in cases where they actually want to
have multiple instances of a shared worker.

-atw

On Tue, Aug 18, 2009 at 7:01 PM, Jonas Sicking <jonas at sicking.cc> wrote:

> On Tue, Aug 18, 2009 at 3:08 PM, Jeremy Orlow<jorlow at chromium.org> wrote:
> > On Tue, Aug 18, 2009 at 1:22 PM, Jonas Sicking <jonas at sicking.cc> wrote:
> >>
> >> On Tue, Aug 18, 2009 at 12:00 AM, Darin Fisher<darin at chromium.org>
> wrote:
> >> > I agree.  Moreover, since a shared worker identified by a given name
> >> > cannot
> >> > be "navigated" elsewhere, the name isn't all that synonymous with
> other
> >> > usages of names (e.g., window.open).  At the very least, it would seem
> >> > helpful to scope the name to the URL to avoid the name conflict issue.
> >> > -Darin
> >>
> >> Technically, that can already be done by using the current the current
> >> URL as the name.
> >
> > I don't quite understand.  Are you suggesting that you can work around
> this
> > by passing the same parameter twice when creating a shared worker?  If
> so,
> > that seems ugly...and a sign that it should be changed.
>
> No, what I mean is that if you want to create a worker shared with
> other instances of the same page, without having to worry about
> collisions from other pages on your site, you can do:
>
> worker = new SharedWorker("/scripts/workerJSFile.js", document.location);
>
> This way you can be sure that no other page on your site happen to use
> the same name.
>
> / Jonas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090818/043a2925/attachment-0002.htm>


More information about the whatwg mailing list