Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does ctypes could be used in WebExtension?

99 views
Skip to first unread message

shang...@hotmail.com

unread,
Jan 27, 2016, 4:06:10 AM1/27/16
to
Hi,

The ctypes is a JavaScript module supply for load native binary file. But in WebExtension there will be another native client for load native binary. My question is does all the JavaScript modules(https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules) will not be supported in WebExtension?
If not is it a way to load the JavaScript modules in the add-on developed with WebExtension? Thank you.

Best Regards,
Erxin.

David Rajchenbach-Teller

unread,
Jan 27, 2016, 5:28:06 AM1/27/16
to dev-ext...@lists.mozilla.org
Hi Erxin,

I seem to remember that, in a "regular" WebExtension, js-ctypes will
be forbidden. Giorgio Maone authored a proposal for "native"
WebExtensions, which would have additional privileges. You can read more
here:
https://discourse.mozilla-community.org/t/proposal-native-js-to-embrace-extend-the-webextensions-api/3457

Cheers,
David
> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>

shang...@hotmail.com

unread,
Jan 28, 2016, 4:26:38 AM1/28/16
to
Hi David,

Currently we have developed several native libraries which are loaded by js-ctypes. The web extension doesn't support js-ctypes is surprised us. As you said currently there is no way to load a native code in WebExtension now. :(
Thank you for your helping!

Best Regards,
Edwin

r.chrz...@medlan.pl

unread,
Sep 15, 2016, 5:52:07 AM9/15/16
to
I too hope that ctypes will be available in WebExtensions. Currently we use it in our unpublished add-on to sign documents with crypt32. We just ask our client to install the extension from our web application and that's it, simple as that. After all our client has to install the add-on himself so nothing happens without his knowledge.
Also possibly we would need ctypes to our other functionality which is printing with custom preferences and to custom printer as it doesn't seem that WebExtension allows that...

Jorge Villalobos

unread,
Sep 16, 2016, 11:08:40 AM9/16/16
to
On 9/15/16 3:51 AM, r.chrz...@medlan.pl wrote:
> I too hope that ctypes will be available in WebExtensions. Currently we use it in our unpublished add-on to sign documents with crypt32. We just ask our client to install the extension from our web application and that's it, simple as that. After all our client has to install the add-on himself so nothing happens without his knowledge.
> Also possibly we would need ctypes to our other functionality which is printing with custom preferences and to custom printer as it doesn't seem that WebExtension allows that...
>

ctypes will not be included in WebExtensions. In the future, you'll need
to use connectNative instead:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/Runtime/connectNative

Jorge

terrell...@gmail.com

unread,
Oct 5, 2016, 5:11:41 AM10/5/16
to
Am I correct that connectNative is more restrictive than JavaScript c-types? It looks like any addon that wanted to allow the user to specify which program to start wouldn't work, as a manifest file must exist for the application. I use such an addon (Image Assistant) all the time--it allows me to open image in GIMP for editing straight from the browser.

r.chrz...@medlan.pl

unread,
Oct 5, 2016, 8:17:43 AM10/5/16
to
It seems so. Connect native requires you to install that native application on each computer because of the need to add keys in registry (in case of Windows) as I understand.

Jorge Villalobos

unread,
Oct 5, 2016, 10:35:53 AM10/5/16
to
Yes, it's more restrictive, but it's also safer. One recurring stability
problem in Firefox has to do with DLLs being loaded in the main process,
and add-ons using js-ctypes are a contributor to this.

Jorge
0 new messages