Is there anyone who has any idea about running executable files from firefox?
I am trying to develop a Firefox add-on to run an exe file through the browser context menu (or VBScript file or CMD command). I tried them and didn't have any results:
- using signed jar files
- using Flash (fscommand)
- using JavaScript (ActiveXObject)
- using Firefox Add-on SDK (nsIProcess & ctypes)
I've always had a very popular ending that says "security issues don't allow this." Does anyone have an idea without a dead end?
source to share
I tried them and had no results: using Firefox Add-on SDK (nsIProcess & ctypes)
addon sdk provides the ability to start processes out of the box: system / child_process
Firefox addons have the full power of a user account on a computer. If the user can start processes, then there is a firefox addon.
So I'm wondering why you have "no results."
source to share
What ctypes have you tried? I am running exe with ctypes on Windows with ShelExecuteEx, on Gtk (Unix) with g_app_info_launch_uris and on OSX with open open. I use these (instead of nsIProcess) because I need it to run separately, which means the startup process doesn't wait for a close or etc response from the running process. Pid pollution occurs when starting unix / linux / mac nsIProcess. The pid value of the startup process will be found in the running assets of the process.
To run with regular nsIProcess follow these steps:
var procFinned = {
observe: function (aSubject, aTopic, aData) {
console.log('bash nsIProcess completed');
}
};
var nsifile = new FileUtils.File('c:\blah\blah.exe');
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
var args = [];
process.init(nsifile);
process.runAsync(args, args.length, procFinned);
source to share