Hello all,
I have been tasked with finding a way to perform actions thru the browser like starting Notepad. Currently, ActiveX is used.
Here is the problem, ActiveX = Microsoft
Thus, I am searching.
I have found a starting point for Mozilla, by using XPCOM, and nsIProcess.
Here is an example:
This functions thru Firefox, but does not thru Chrome.Code:function Doit(){ alert('Starting Notepad'); //Set permissions to allow XPCOM netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); // create an nsILocalFile for the executable var file = Components.classes["@mozilla.org/file/local;1"].getService(Components.interfaces.nsILocalFile); file.initWithPath("c:\\windows\\NOTEPAD.EXE"); // create an nsIProcess var process = Components.classes["@mozilla.org/process/util;1"].getService(Components.interfaces.nsIProcess); process.init(file); // Run the process. // If first param is true, calling process will be blocked until // called process terminates. // Second and third params are used to pass command-line arguments // to the process. var args = ["c:\\autoexec.bat"]; process.run(false, args, args.length); }
I have found that XPCOM is Mozilla only, and the "replacement" is npruntime.
I would like to be able to offer a solution that is cross-browser compatible, IE: Chrome.
Thanks,
Eric


LinkBack URL
About LinkBacks



Reply With Quote


