How to run a local exe in my firefox extension?
16,962
Since you've explicitly asked for an .exe then you can use nsILocalFile.launch()
:
https://developer.mozilla.org/en/Code_snippets/Running_applications
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("c:\\myapp.exe");
file.launch();
If you wanted to make it cross-platform you should look into nsIProcess
Author by
jin
Updated on June 12, 2022Comments
-
jin almost 2 years
I want to run a local exe in my firefox extension javascript file, but ActiveXObject("WScript.Shell") is work fine in IE,not in FF,how to run a local exe in js in firefox.
-
daveloyall over 9 yearsWouldn't that let ANY webpage invoke arbitrary executables?
-
McK almost 8 yearsYou should not just paste a link, but summarize the content. If the link is broken in the future, your whole answer doesn't have any value any more.
-
Yohanim over 7 years
Components.classes
is not accessible via JavaScript running in a webpage, it is only accessible via JavaScript running in a Firefox extension -
pawel over 7 years@NPE which is precisely the use case described in the question, isn't it?
-
Anderson Green almost 2 yearsThe link in this answer is now broken.