带有Web Worker Thread的NPAPI插件

时间:2013-07-08 20:00:36

标签: npapi web-worker

我知道从Javascript访问NPAPI插件,我能够实现两者之间的通信。

我想知道是否可以从Web Worked Thread访问NPAPI插件公开的API?

1 个答案:

答案 0 :(得分:3)

从Web工作线程访问NPAPI插件与从Web sorker线程访问任何其他DOM元素完全相同。来自the mozilla documention

There's no access to non-thread safe components or the DOM and you have to pass specific data in and out of a thread through serialized objects.

NPAPI不​​了解网络工作者,因此它是非线程安全的。事实上,与javascript对话的NPAPI插件中的所有调用都必须在主线程上进行;所有NPN_函数(有一些特定的例外)只能在主线程上调用。 NPAPI不​​是线程感知的。

摘要 :不,你不能。