How to set firefox so that it asks for profile while opening?
How to set Firefox so that it will ask choose profile while running Firefox ? Can i edit the Firefox binary for the same ? if yes, how can it be possible ?
Solution 1:
If you are not using Unity
-
Copy the global
firefox.desktop
file to~/.local/share/applications
:cp /usr/share/applications/firefox.desktop ~/.local/share/applications
-
Open the local copy with
gedit
:gedit ~/.local/share/applications/firefox.desktop
-
Look for the first line, starting with
Exec=
Change it into
Exec=firefox -P
-
Log out and back in, now when you run firefox, it will show:
If you are using Unity:
There is another option to conveniently choose between profiles:
Add both profiles to the firefox quicklist.
To do so
-
copy the global
firefox.desktop
file to~/.local/share/applications
:cp /usr/share/applications/firefox.desktop ~/.local/share/applications
-
Then open the local copy:
gedit ~/.local/share/applications/firefox.desktop
and look for the line:
Actions=NewWindow;NewPrivateWindow;
[I'll use default and TestTest as examples for your profiles, replace the names by your real profile names.]
Change the line into:
Actions=NewWindow;NewPrivateWindow;default;TestTest;
-
Now add the following section to the very bottom of the file:
[Desktop Action TestTest] Name=TestTest Exec=firefox -P TestTest OnlyShowIn=Unity; [Desktop Action default] Name=default Exec=firefox -P default OnlyShowIn=Unity;
log out and back in, your Firefox launcher should look like in the image, and you can choose from which profile to open a new window.
EDIT
As requested by OP, an additional section. The solution above works fine, but new windows are opened in the same profile.
To avoid that, add another item to your firefox
quicklist, to open a new window with an arbitrary profile. To do so:
- Open the local
firefox.desktop
file that you created (copied), as described in the answer. -
Look (again) for the line:
Actions=NewWindow;NewPrivateWindow;default;TestTest;
change it into:
Actions=NewWindow;NewPrivateWindow;default;TestTest;New window with profile;
-
Add to the very end of your file a section:
[Desktop Action New window with profile] Name=New window with profile Exec=firefox -new-instance -P OnlyShowIn=Unity;
Now you can choose to open a new window in a specific profile:
Solution 2:
Or when you don't want to change your desktop files you can simply edit ~/.mozilla/firefox/profiles.ini
and change line:
StartWithLastProfile=1
to:
StartWithLastProfile=0
Solution 3:
Finally i managed to edit the binary of Firefox to get the profile while opening.
Open /usr/bin/firefox
file in any text editor with sudo
privilege and edit the last part of the file.
After editing that file would be look like this.
else
exec $MOZ_LIBDIR/$MOZ_APP_NAME -P --no-remote "$@"
fi
Thats all. After saving the file when you open Firefox it will ask for profile.