[whatwg] Using Web Workers without external files

Ian Hickson ian at hixie.ch
Wed Oct 14 03:21:48 PDT 2009


On Wed, 23 Sep 2009, Simon Pieters wrote:
>
> I'd like a way to use workers without having to use an external resource. This
> would allow easier testing, mashups, small standalone apps, and so forth.

I agree that it makes sense to support this on the long run. However, for 
the short run, I think using eval() is sufficient.

If people feel strongly about this, my proposal would be to use sicking's 
idea of just allowing data: URLs. Specifically, making step 3 of the 
Worker() constructor (not SharedWorker) allow data: URLs as a special 
case. That's an easy thing to do, and it's not like we'll ever use data: 
URLs in this context for something else.


On Thu, 24 Sep 2009, Marius Gundersen wrote:
> 
> What about a javascript: url, like the addressbar and links already accept?

That wouldn't have quite the right semantics -- they'd be evaluated in the 
content of the original script (or in a blank execution context, dependeng 
on how we defined it), and then their return value would be executed... 
that's one level of indirection too far.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list