[whatwg] SharedWorkers and the name parameter

Mike Wilson mikewse at hotmail.com
Sun Aug 16 09:42:16 PDT 2009


Drew Wilson wrote:
> Per section 4.8.3 of the SharedWorkers spec, if a 
> page loads a shared worker with a url and name, 
> it is illegal for any other page under the same 
> origin to load a worker with the same name but a 
> different URL -- the SharedWorker name becomes 
> essentially a shared global namespace across all 
> pages in a single origin. This causes problems 
> when you have multiple pages under the same 
> domain (ala geocities.com) - the pages all need 
> to coordinate in their use of "name". 

I agree with you that this is a problem, and the 
same problem exists in WebStorage (storage areas
are set up per origin). F ex, the sites
http://www.google.com/calendar and 
http://www.google.com/reader, and every other site
based off www.google.com will compete for the same
keys in one big shared storage area.

It seems lately everything is being based on having 
unique host names, and path is not being considered 
anymore, which I think it should.

An alternative model would be to follow what 
cookies do with cookie.path, to allow the 
application itself decide on what URL should be 
used as the "namespace root". Allowed values would 
be in the range from the bare host name (~origin) 
up to the file URL (per your suggestion).

(Then if even Document.domain could be enhanced 
with something to allow subsetting on path it'd be 
great. But that has probably been discussed to death 
a long time ago ;-)

Best regards
Mike Wilson



More information about the whatwg mailing list