dagda1
dagda1

Reputation: 28770

Web workers and accessing object attached to the window object

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?

Upvotes: 10

Views: 16786

Answers (1)

Jivings
Jivings

Reputation: 23250

Short 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.

Upvotes: 20

Related Questions