run linux command within firefox

来源:互联网 发布:九阴绝学兽魂进阶数据 编辑:程序博客网 时间:2024/04/29 15:06

function startRDPOnLinux(vmip){
    if(!isNotActivex()){
        return false;
    }
    if(checkBrow()=="ie"){
        alert("Linux平台下只支持Firefox浏览器!");
    } else {  //firefox
        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
        var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
        file.initWithPath("/usr/local/bin/rdesktop");
        var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);  
       process.init(file);
       var args = [vmip, "-f"];
       process.run(false, args, args.length);
       }
}