Closed Bug 1215067 Opened 9 years ago Closed 8 years ago

js-ctypes support for extensions

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: gkrizsanits, Unassigned)

References

Details

(Whiteboard: [design-decision-needed][triaged])

- Bundling and use of js-ctypes libraries with extensions. The code would be loaded into the add-on process (once we implement out-of-process WebExtensions). We could choose whether to sandbox the process or not. The DLL could be loaded before entering the sandbox.

- Permission to use js-ctypes from the chrome process.
Just because I was curious, MXR shows 293 add-ons that use js-ctypes (you need to dedupe that list).

https://mxr.mozilla.org/addons/search?string=ctypes.jsm&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=addons
Flags: blocking-webextensions-
For what it's worth, people who port anything that uses ctypes to the WebExtensions API may want to check Chromium's NPAPI deprecation guide for alternatives: https://www.chromium.org/developers/npapi-deprecation#TOC-Alternatives-to-NPAPI
Whiteboard: triaged
My addon "System Monitor" directly uses libraries installed in the platform itself. On WebExtensions, do I have to create a new NPAPI plugin as a bridge when the js-ctypes is killed?
https://addons.mozilla.org/firefox/addon/system-monitor/
(In reply to YUKI "Piro" Hiroshi from comment #3)
> My addon "System Monitor" directly uses libraries installed in the platform
> itself. On WebExtensions, do I have to create a new NPAPI plugin as a bridge
> when the js-ctypes is killed?
> https://addons.mozilla.org/firefox/addon/system-monitor/

I think your best bet here would be to create a native application that loads these libraries and then speaks the native messaging protocol, and then use something like runtime.connectNative.  See bug 1190682.
I agree that my addon should use runtime.connectNative() and should include its custom binaries for each platform. Actually, the addon had binary XPCOM components for each platform, at old versions. The js-ctypes made my addon just binary-free.

Anyway, something code snippets or a public library to communicate with Firefox based on runtime.connectNative() seems to be required, for addon developers who require binary components.
Whiteboard: triaged → [design-decision-needed][triaged]
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.