Web workers and accessing object attached to the window object

ぐ巨炮叔叔 提交于 2019-11-28 00:20:21
Jivings

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!