I need to write an extension for Thunderbird. The extension will be used to do some text mining and relies on native C++ code. From my understanding, Thunderbird extensions are now mostly written in JavaScript and XPCOM is being slowly deprecated (https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM).
Besides, XPCOM seems a bit heavy and I would like an easier path to access my C++ code. Are there any alternatives besides XPCOM to access C++ code from a thunderbird extension?
Thanks!
Take a look at js-ctypes (https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes)
Little example:
Also be aware that C++ compiler does name mangling due to function overloading so your function name might be 'concatStrings' in C++ code, but then in assembly it might be something like '_123concatStrings'. To prevent this declare your function like: