2013-07-08 29 views
0

我知道从Javascript访问NPAPI插件,我能够实现两者之间的沟通。NPAPI插件与Web工作线程

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

回答

3

从Web工作线程访问NPAPI插件与访问网络线程线程中的任何其他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不​​是线程感知的。

摘要:不,你不能。