我想在我的 firefox 扩展 javascript 文件中运行一个本地 exe,但是 ActiveXObject("WScript.Shell") 在 IE 中工作正常,在 FF 中不行,如何在 firefox 中的 js 中运行一个本地 exe。
最佳答案
既然你已经明确要求一个 .exe,那么你可以使用 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();
如果你想让它跨平台,你应该看看nsIProcess
关于javascript - 如何在我的 firefox 扩展中运行本地 exe?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2490713/