从javascript打开firefox multifox窗口

时间:2014-07-05 02:07:30

标签: javascript firefox-addon

我想打开多个Firefox配置文件。我使用Multifox,但现在我想打开一个具有特定配置文件的网页。我可以在Multifox中手动完成,但我想从Javascript中完成。

让我说我的网页上有这个功能

function openProf (profile_number,webpage){


}

如果我想在multifox 10th个人资料窗口中打开Facebook,我可以致电

openProf(10,"www.facebook.com");

有人可以告诉我该怎么做吗?

1 个答案:

答案 0 :(得分:2)

Cu.import('resource://gre/modules/FileUtils.jsm');
var exe = FileUtils.getFile('XREExeF', []); //this gives path to executable
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess);
process.init(exe);
var args = ['-P', 'YOUR_PROFILE_NAME_HERE', '-no-remote', 'http://www.bing.com/'];
process.run(false, args, args.length);