【发布时间】:2013-01-02 18:29:07
【问题描述】:
从https://github.com/axgle/npapi-chrome-plugin-helloworld 下载了 NPAPI hello-world 插件,并使用 Chrome 开发者模式将其打包为 chrome 扩展 (crx)。
在 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 m)
感谢您在这方面的任何帮助。
【问题讨论】:
标签: npapi