2013-07-08 35 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不​​是線程感知的。

摘要:不,你不能。