【发布时间】:2013-12-30 10:24:16
【问题描述】:
在我的旧 Web 应用程序中,我需要从 JS 读取用户系统注册表并做一些其他事情。出于安全原因,我不能不使用 ActiveX,所以我编写了一个插件。我的插件由一个 DLL 文件组成,它是一个 COM 组件。这个 COM 组件公开了一些我从 Java Script 代码调用的函数。
在 IE 中,我将我的 DLL 打包到一个 CAB 文件中并安装它,比如 test.dll,方法如下:
<object classid="clsid:some class id here" codebase="test.cab" height="0" width="0" onError="testInstalled=false; return true;" id="testComp"></object>
上面的 HTML 标签将 COM 组件作为插件安装在 IE 中,我可以从我的 JS 代码中访问相同的公开功能:
var testCompApp = document.testComp;
testCompApp.callSomeFunction();
它在 IE 中运行良好。我在其他浏览器(Chrome、Firefox、Safari)中需要相同的功能
您能否建议如何使用我的 DLL 文件为其他浏览器开发插件?
谢谢,
【问题讨论】:
-
@Georg Fritzsche,是的 link How to write a browser plugin? 类似
标签: com npapi browser-plugin