2013-01-02 24 views
2

https://github.com/axgle/npapi-chrome-plugin-helloworld下载了NPAPI hello-world插件,并使用Chrome开发者模式将其打包为Chrome扩展(crx)。无法在Chrome浏览器中将npapi helloworld插件作为扩展程序加载

在Chrome浏览器中加载了上述扩展名,并尝试在Chrome浏览器中打开test.html(随上述插件提供)。但它说:“无法加载插件”

下面是test.html的

<doctype html> 
<html> 
<head> 
<script> 
window.onload = function(){ 
    test = document.getElementById("pluginObj"); 
    alert(test.sayHello()); 
} 
</script> 
</head> 
<embed id="pluginObj" type="application/x-helloworld"> 
<body></body> 
</html> 

按我的验证的源代码,插件越来越嵌入(因为在改变测试它给HTML文档对象),但无法调用插件的sayHello方法。

但是,当我试图在另一台PC上加载上述扩展时,它正确加载并能够调用插件的sayHello方法。 这两个系统具有相同的操作系统(Windows XP + SP3),并且两个系统都使用同一版本的Chrome浏览器(23.0.1271.97米)

欣赏此方面的任何帮助。

回答

1

当您将其添加到CRX中时,是否将其标记为公开?如果你不这样做,它将不会在扩展名外部可见。

the relevant docs

这里是另一个相关的问题:Google Chrome Extensions and NPAPI

+0

是我做到了。 “npapi_helloworld”, \t “版本”:manifest.json的 { \t “名称” 的结构 “1.0”, \t “BACKGROUND_PAGE”: “的test.html”, \t “manifest_version”:2, \t“描述“:”npapi的小helloworld示例“, ”插件“:[ {”path“:”plugin/npsimple.dll“,”public“:true} ] } – Goku

+0

尝试在依赖项中打开DLL然后看看机器上是否有任何缺失的依赖关系,它无法正常工作。 msvcrt.dll很快浮现在脑海中 – taxilian

+0

是DLL依赖于msvcp100d.dll和msvcr100d.dll。将这些dll与扩展一起打包并工作。感谢你的帮助。 – Goku

相关问题