使用 NPAPI 插件将 XPCOM Firefox 扩展移植到 Chrome 扩展
我有一个扩展,它使用 Firefox 中的 XPCOM 来工作。现在我想将其移植到 Chrome。由于使用它的唯一方法是使用npapi和npruntime,我想我必须重写至少所有的粘合。
为了保留尽可能多的源代码,我正在考虑编写一个类似于 Mozilla 中的 header.py
的 idl
转换器。这是否已经完成和/或是否有任何资源可用于从 XPCOM 切换到 NPAPI?
I have a extension, which uses XPCOM in Firefox to work. Now I would like to port that one to Chrome. Since the only way to use it is by using npapi and npruntime, I think I have to rewrite at least all the glue.
To keep as much of the sourcecode as possible, I was thinking of writing a idl
converter similar to the header.py
in Mozilla. Has this already been done and/or are there any resources for the switch from XPCOM to NPAPI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,NPAPI 只有一种“粘合”生成器,那就是 nixysa。不过,如果是我,我会直接将其移植到 FireBreath;可能不会比直接将其移植到 npruntime 更困难,然后您就可以利用活跃社区为不同浏览器找到的所有调整和修复,并可能在其他浏览器中使用它。
不过,我在插件世界里已经有一段时间了,但我从未见过任何将 XPCOM .idl 转换为其他格式之一的东西;我认为创建这样一个东西并不那么困难,但我怀疑现在很多人都需要它。
希望那里有帮助。
There is only one "glue" generator that I know of for NPAPI, and that is nixysa. If it were me, though, I'd just go ahead and port it to FireBreath; likely it wouldn't be any harder than porting it to straight npruntime and you'd then be able to take advantage of all the tweaks and fixes that an active community has found for different browsers, as well as potentially use it in other browsers.
I've been around in the plugin world for awhile, though, and I have never seen anything that converts a XPCOM .idl to one of the other formats; I don't think it'd be all that difficult to create such a thing, but I doubt many would need it at this point.
Hopefully something there helps.