简体   繁体   English

使用NPAPI插件将XPCOM Firefox扩展移植到Chrome扩展

[英]Porting XPCOM Firefox extension to Chrome extension with NPAPI plugin

I have a extension, which uses XPCOM in Firefox to work. 我有一个扩展,它在Firefox中使用XPCOM来工作。 Now I would like to port that one to Chrome . 现在我想把那个移植到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. 由于使用它的唯一方法是使用npapinpruntime ,我认为我至少必须重写所有胶水。

To keep as much of the sourcecode as possible, I was thinking of writing a idl converter similar to the header.py in Mozilla . 为了尽可能多地保留源代码,我正在考虑编写类似于Mozilla中header.pyidl转换器。 Has this already been done and/or are there any resources for the switch from XPCOM to NPAPI ? XPCOMNPAPI的转换是否已经完成和/或有任何资源?

There is only one "glue" generator that I know of for NPAPI, and that is nixysa . 我只知道一个用于NPAPI的“胶水”生成器,即nixysa If it were me, though, I'd just go ahead and port it to FireBreath ; 如果是我,我就继续将其移植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. 可能比将其移植到直接的npruntime并不困难,然后您就可以利用活跃社区为不同浏览器找到的所有调整和修复,并有可能在其他浏览器中使用它。

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; 不过,我已经在插件世界中待了一段时间,而且从未见过将XPCOM .idl转换为其他格式之一的任何东西。 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. 希望那里有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM