I have a Thunderbird extension that mutates message bodies using an external executable. Currently I do a hack-job and just place this executable in /tmp/someBinary
and call it like so:
var exe = FileUtils.File("/tmp/someBinary");
var proc = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
proc.init(exe);
var args = [msgBody.path];
proc.run(true, args, args.length);
This is obviously stupid, it would be nice to call it via URI and bundle the executable with the application. Sadly, my limited JS means I only came up with the following:
var URL = ios.newURI("chrome://myExtension/content/someBinary",null,null);
var exe = URL.QueryInterface(Components.interfaces.nsIFileURL).file;
But that isn't quite right. Is there a normal way to get this done?