编写带有本机窗口界面的 Firefox XPCOM 插件? (如 ActiveX 控件)
我有一个在 Internet Explorer 和 ActiveX 控件测试容器程序中运行良好的 ActiveX 控件。 控件的实际行为分为两部分,其中一部分是与 OLE 主机交互的 ATL 内容,另一部分是真正的内容,它只接收窗口附加、调整大小、绘图和鼠标/键盘的回调事件。
现在,我想为 Firefox 插件编写相当于 ATL 的东西(最好是在同一个二进制文件中,这样我不需要链接两个二进制文件,但我可以在这里灵活处理)。 我已经下载并使用 Gecko SDK 来构建 XPCOM 组件,这似乎可以工作,但我无法弄清楚要实现哪些接口才能使该组件作为 Firefox 中的嵌入式本机 UI 组件使用。 这与 Flash 播放器插件、PDF 查看器插件、QuickTime 播放器插件等的需求类似 - javascript 和 XUL 是不够的。
我在网上寻找了示例,但我能找到的唯一示例是基于看似古老的 NS_PluginInitialize() / NS_NewPluginInstance() 接口,它不是 XPCOM(但有其他名称?)。
有没有办法通过XPCOM实现同样的事情? 如果是这样,怎么办? 是否存在关于如何执行此操作的任何概述文档(不仅仅是接口成员列表)?
I have an ActiveX control that works fine in Internet Explorer and the ActiveX Control Test Container program. The actual behavior of the control is split in two parts, where one part is the ATL gunk that interfaces with the OLE host, and the other part is the real meat, which just receives callbacks for window attach, sizing, drawing and mouse/keyboard events.
Now, I want to write the equivalent of the ATL gunk, for a Firefox plug-in (ideally in the same binary, so I don't need to link two binaries, but I can be flexible here). I have downloaded and used the Gecko SDK to build an XPCOM component, and that seems to work, but I can't figure out which interfaces to implement to make the component available as an embedded native UI component in Firefox. This is similar in needs to the Flash player plug-in, PDF Viewer plug-in, QuickTime player plug-in, etc -- javascript and XUL won't be enough.
I've looked for examples on the web, but the only examples I can find are based on the seemingly ancient NS_PluginInitialize() / NS_NewPluginInstance() interface, which is not XPCOM (but has some other name?).
Is there a way to achieve the same thing through XPCOM? If so, how? And does there exist any overview documentation at all (not just interface member listings) about how to go about doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊啊,答案刚刚在另一个网络搜索中弹出。 好吧,至少某根绳子的开头,当拉得足够长时,可能会回答这个问题。
https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug- in_Basics#Windowed_and_Windowless_Plug-ins
Aaaand the answer just popped up on another web search. Well, at least the beginning of some piece of string that, when pulled for long enough, will probably answer the question.
https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Basics#Windowed_and_Windowless_Plug-ins