如何在Linux上使用firefox扩展运行linux程序

时间:2013-07-16 15:04:09

标签: linux firefox firefox-addon add-on

我想知道如何在linux上使用firefox extenion运行一个外部程序,如C程序。我在下面做了什么,我不知道哪里出错,这些代码在windows.please上工作得很好我,非常感谢你!

     var file = Components.classes["@mozilla.org/file/local;1"]

        .createInstance(Components.interfaces.nsIFile);

    file.initWithPath("~//Desktop//a.out");


    var process = Components.classes["@mozilla.org/process/util;1"]

        .createInstance(Components.interfaces.nsIProcess);

    process.init(file);

    var args = ["argument1", "argument2"];

    process.run(false, args, args.length);

0 个答案:

没有答案