Javascript 无法访问Firefox扩展中的NPAPI函数
我很难在Firefox扩展中加载NPAPI插件。我现在的做法是插件已经在Windows中注册,所以我通过一个覆盖层加载一个嵌入元素,该覆盖层被注入到chrome中&通过window.onload访问。显然,NPAPI元素已加载,但我无法访问任何本机函数 这是我的主要观点。xul:Javascript 无法访问Firefox扩展中的NPAPI函数,javascript,firefox,npapi,Javascript,Firefox,Npapi,我很难在Firefox扩展中加载NPAPI插件。我现在的做法是插件已经在Windows中注册,所以我通过一个覆盖层加载一个嵌入元素,该覆盖层被注入到chrome中&通过window.onload访问。显然,NPAPI元素已加载,但我无法访问任何本机函数 这是我的主要观点。xul: <overlay ...> <window id="main-window"> <embed type="application/x-myplugin" id="myplugi
<overlay ...>
<window id="main-window">
<embed type="application/x-myplugin" id="myplugin" width="300" height="300"></embed>
</window>
</overlay>
转储文件:
[object XULElement]
undefined
如果将相同的嵌入代码放入HTML文档中,plugin.version将返回“1000”。NPAPI插件已经确认可以工作了,因为我可以在HTML文档中找到它,并加载到Chrome扩展中
我做错什么了吗?请注意,我必须在chrome中加载NPAPI插件,而不是按需将其注入页面,因为属性需要从与网页分离的其他对话框中检索。也许还有另一种加载NPAPI插件的方法,可以在每次加载浏览器时加载一次,该插件可以从Firefox扩展调用
如果有帮助的话,NPAPI是使用Firebreath框架构建的
注意:我已经完成了这个线程:显然可以加载插件,但仍然无法访问任何函数
谢谢。中没有
标记,您的意思是使用HTML
标记。使用此标记的HTML命名空间:
<embed xmlns="http://www.w3.org/1999/xhtml" ...></embed>
其他信息:
<embed xmlns="http://www.w3.org/1999/xhtml" ...></embed>