I have an ember application that I create like this:
window.App = Ember.Application.create({});
I want to do some background processing on a web worker.
How can I get access to the window object or some other global object in the separate web worker thread?
I have an ember application that I create like this:
window.App = Ember.Application.create({});
I want to do some background processing on a web worker.
How can I get access to the window object or some other global object in the separate web worker thread?
Share Improve this question edited Jun 8, 2012 at 9:06 dagda1 asked Jun 8, 2012 at 8:47 dagda1dagda1 28.8k67 gold badges255 silver badges477 bronze badges 4 |1 Answer
Reset to default 20Short answer. You can't.
The only resources available to web workers are that which they load from JavaScript files using importScripts()
or anything that is passed to them via postMessage()
.
You can however now pass Objects to them. They are serialized and de-serialized to JSON automatically.
Also, there is no access to local storage from the Worker.
postMessage()
to send state back? – alex Commented Jun 8, 2012 at 8:49