Search code examples
firefoxgoogle-chromegoogle-chrome-extensionnpapixpcom

Porting XPCOM Firefox extension to Chrome extension with NPAPI plugin


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?


Solution

  • 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.