Closed Bug 873020 Opened 11 years ago Closed 11 years ago

[Workers] importScriptsIn()

Categories

(Core :: DOM: Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: Yoric, Unassigned)

References

(Blocks 1 open bug)

Details

To implement a module loader for workers (bug 872421), it would be extremely useful to have the following global function:

importScriptsIn(object, url1, url2, ...)
// Load and execute scripts at url1, url2, ..., as |importScripts| but add any toplevel value as fields of |object|, instead of the worker scope.
This would need to be proposed to the public-webapps@w3.org mailing list.
Well, for the moment, I am more concerned with chrome workers, so I would be satisfied with having |mozImportScriptsIn()|.

But if you want, I can submit to w3 or whatwg.
Yeah, ChromeWorker shouldn't diverge from Worker unless there are security concerns imo.
I have found how to almost encode the behavior I need using importScripts(), XMLHttpRequest, URL.createObjectURL() and a few tricks. The only thing I seem to be missing is having the right names in fields .fileName and .stack. I can live with this for the moment.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.