Web workers and accessing object attached to the window object

前端 未结 1 1438
醉酒成梦
醉酒成梦 2020-12-06 14:06

I have an ember application that I create like this:

window.App = Ember.Application.create({});

I want to do some background processing on

相关标签:
1条回答
  • 2020-12-06 14:47

    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.

    0 讨论(0)
提交回复
热议问题