Bug 518721 - Implement jsctypes with raw JSAPI
Status: SOLVED FIXED!!!
That’s an awesome news for mozilla’s developpers!
JS Ctypes aims to provide the same library than Python Ctypes :
simpler code -> less work -> simpler review
This new feature is going to greatly ease platform specific developpement
like windows management, system calls, … For example we’re able to call
maintain any C++ XPCOM!
One side effect is that it will ease code review for https://addons.mozilla.org/ too! Instead of shipping an obscure dynamic library with our extension, we may build only a JS-Ctypes wrapper and call directly OS libraries or call a common library that can be validated by reviewers with some MD5 checks.
simpler code -> less knownledge -> better learning curve
This is going to simplify the use of native code too! You can now build native code without having to learn any mozilla "things" (XPCOM, specific build layout/system, …) You will just have to expose your library with a C api and write a simple JS-CTypes wrapper.
- First retrieve Firefox 3.6b1pre nightly or Firefox 3.7a1pre nightly
- On windows, copy and paste this code in your JS console.
This will display an OS native dialog.
(Change the dll path if your main windows directory is not on C:\WINDOWS!)