Start with Firefox version 13, the --new-instance
switch is added. It is better to do it this way, with the help of a bash script:
firefox -P <profile_name> -remote "ping()" || firefox --new-instance -P <profile_name> <url> && firefox -P <profile_name> -remote "openurl(<url>,new-window)"
Changing from new-window
to new-tab
will cause the URL open in a new tab in profile instead.
Break it down:
firefox -P <profile_name> -remote "ping()"
does the running instance check.
|| firefox --new-instance -P <profile_name> <url>
double pipe ||
means if the check fails, it will start a new instance with given profile.
&& firefox -P <profile_name> -remote "openurl(<url>,new-window)"
and of course, &&
means, if the check succeeds, it will re-use the existing instance to open the URL in a new window.
Does it matter if each profile starts in different firefox process? also Windows or Linux? – Nima G – 2012-06-22T13:49:30.867
Doesn't matter, Windows and Linux. – leeand00 – 2012-06-22T14:45:46.890
@Nima Is it possible to start different profiles in the same process but another window? – dash17291 – 2013-12-01T13:59:28.703
@dash17291 Sorry I don't know. – Nima G – 2013-12-02T22:03:20.053