Will wrote:
I am looking for a way to start a trusted Linux application (a C executable)
on my local machine, upon clicking a link. Basically the equivalent of
the ActiveXObject in IE.
Well if a link in a HTML document loaded from a HTTP server could simply
start local applications browsers would have big security holes.
Mozilla has some XPCOM mechanism to start a process, see
http://groups.google.com/groups?q=ns...lla.org&rnum=2
but unless you run your pages from chrome or sign your script you
shouldn't be able to use that mechanism.
If your HTML page with the script is loaded from file: URL you can
request the privilege to use XPConnect (XPCOM via JavaScript), here is
an example tried successfully on Windows to run notepad.exe:
netscape.security.PrivilegeManager.enablePrivilege ('UniversalXPConnect');
var process =
Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
var file =
Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile );
file.initWithPath("C:\\Windows\\notepad.exe");
process.init(file);
process.run(false, [""], 1);
thus I guess if you pass the right LINUX path to an executable to
initWithPath that example should work as well. Please report back to the
JavaScript group if it does
--
Martin Honnen
http://JavaScript.FAQTs.com/