Re: NPAPI replacement for those of us who still need system API access

[email protected] Mon, 12 Oct 2015 12:57:11 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.plugins
Message-ID <[email protected]>
On Friday, October 9, 2015 at 6:07:30 PM UTC-6, Chris Peterson wrote:
> On 10/9/15 1:38 PM, Richard Bateman wrote:
> > What is your strategy going forward with that?  Google has given us Native Messaging.  It's a terribly obnoxious API to deal with and extremely inefficient in a lot of ways, but it does provide us with a method of communicating with a native application.  Does FireFox have something similar? If not, do you plan to add something similar or at least something that could be used for a similar purpose by the time that NPAPI is deprecated?
> 
> The proposed solution is to create a Firefox extension that talks to 
> native code. The APIs listed below are some options.
> 
> Mozilla really ought to create some example extensions demonstrating 
> these approaches. They would be a good starting place for developers 
> wanting to port their NPAPI plugin to an extension.
> 
> * child_process API
> 
> https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/system_child_process
> 
> * ctypes
> 
> https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes
> 
> * WebUSB API (available on Firefox OS, but not yet available to desktop 
> extensions)
> 
> http://reillyeon.github.io/webusb/
> https://github.com/alexsalas/WebUSB

Very interesting... I appreciate the information!

Is js-ctypes still a viable method? For some reason I was under the impression that we weren't allowed to include a binary in an XPI.

What restrictions will there be on use of the child_process API? I assume you can't just launch any arbitrary executable, so how does the security model work? This is shown as experimental; is it already usable in FireFox or does it require a development version?

With either case, is it possible to communicate from the extension into the page (possibly using window messages like in Chrome?) so that the functionality can be exposed to the page?

I appreciate the information; I have been trying to find this information myself, but some of the pages look potentially out of date and others seem to lack the relevant information (such as which version the child_process API is available in and security models).

Richard