How-to force brave to always open in a specified profile

Description of the issue:

  1. Clicking on the brave launcher often opens a page in a profile that is not what I assume as my “Default Profile”

  2. When I click on a link inside another app to “open in browser” Brave is correctly launched but often in a Profile that I did not expect.

Expected result:
I want to set a Profile to ALWAYS ALWAYS ALWAYS open no matter what. I want the profile that I set to always open first.

I don’t want to mix cookies in between profiles. For privacy I keep those cookies separate and when a page gets accidentally launched in one of my private profiles, it is aggravating.

Thanks for any help.

Brave Version( check About Brave):

Version 1.28.105 Chromium: 92.0.4515.131 (Official Build) (64-bit)

There is no way to set a default user profile as of the moment. What you could do currently, is use profile-specific shortcuts so you always open the correct user profile. Using the default shortcut will always open the user profile you closed last.

There are Github issues regarding the subject.

1 Like

Question: are these two command line options related somehow?

--profile-directory 	Selects directory of profile to associate with the first browser launched.
--user-data-dir         Directory where the browser stores the user profile.

(from the How Do I Use Command Line Flags in Brave? page)

Just asking before I bork something trying out… the description is somewhat dry.
What do they do exactly?

But the developer had to design it to do that.
Wouldn’t it have been better to design it to always open in the Profile that had been first created or one that was set as “default” in the preferences?

Why this monkey decision that gives us profiles opening randomly and sharing cookies everywhere

@elder-n00b

The first one is related. For the current example, I created a specific desktop shortcut that will always open my daily profile. It corresponds to the default directory, other user profiles will be Profile X where X is a number.

Here is how it’s launched:

"C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe" --profile-directory="Default"

For better understanding of that, you could open C:\Users\User\AppData\Local\BraveSoftware\Brave-Browser\User Data and check how your user profiles are stored.

But like I said twice, Brave allows users to create specific desktop shortcuts easily, so it’s not really needed to burden yourself with directories and such.

@boomerlife

I don’t have Google Chrome installed on my PC so can’t test, but I think that’s how it works there too, and Brave developers haven’t bothered to change the behavior of Chromium.

Until the Github issues I listed above have been addressed, you could achieve what you want by creating a specific shortcut for the wanted user profile. It’s done via brave://settings/manageProfile while in the user profile of choice.

1 Like

Too bad that the linux version of brave does not have that option. There is no “create shortcut for this profile” option in the linux version in brave://settings/manageProfile

That’s interesting, I wasn’t aware there was such a difference between Brave on Windows and Brave on Linux.

The option is located at the bottom of the page in the Windows version, you made sure to check the whole page, right?

Yes. It is not there. On my Windows computer I have already set this up. I am not using the snap version either. This is the install right from the Brave site itself.

Ubuntu 21.04

That’s a pity. Could you please check the following for me:

  1. Open the desired user profile.
  2. Type brave://version.
  3. Check for a line Profile Path.
2 Likes

Look into xdg-open and how it opens urls.
This seems to have useful information.
You would have to make a .desktop shortcut that includes the above mentioned command line option and choose that with xdg-settings set default-web-browser brave-profilename.desktop.
Sorry I can’t check because my Linux box gave up time ago.
Any Linux user to the rescue?

The --profile-directory parameter works on Ubuntu.

All you have to do is find out the correct name of the user profile’s directory.

Profile Path /home/username/.config/BraveSoftware/Brave-Browser/Profile 1

Use this name with the --profile-directory parameter.

--profile-directory='Profile 1'

Here is my .desktop file for Brave

[Desktop Entry]
Version=1.0
Name=Brave Web Browser
GenericName=Web Browser
Comment=Access the Internet

Exec=/usr/bin/brave-browser-stable %U

StartupNotify=true
Terminal=false
Icon=brave-browser
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
Exec=/usr/bin/brave-browser-stable

[Desktop Action new-private-window]
Name=New Incognito Window
Exec=/usr/bin/brave-browser-stable --incognito

So you are saying wherever it says Exec I need to append --profile-directory=Profile 1 to the end of that line?

Exec=/usr/bin/brave-browser-stable --profile-directory=Profile 1 %U

?

I think so. I’d put 'Profile 1' in quotes though, not sure if single or double.
If you modify the file directly, no need to tamper with xdg-open I guess.
edit: in that case, check if it survives a Brave update, perhaps it rewrites its .desktop file.
edit: those “Desktop Action” sections are interesting too. I think you may add custom ones.

I have never used Linux so I’m unaware of all that, but it makes sense to me to append the parameter over here:

Exec=/usr/bin/brave-browser-stable --profile-directory='Profile 1' %U

I’ve used single quotes and it seems to be working

Exec=/usr/bin/brave-browser-stable --profile-directory='Profile 1' %U

I remember something about .desktop files having trouble with double quotes.

Anyways for now it seems to be working. If I have trouble this week, I will be back.

Thanks all.

I also edited the New window settings and incognito settings in Exec in the .desktop file.

Thanks

3 Likes

Oh, glad it worked for you! I wish you could easily create specific desktop shortcuts on Linux as you could on Windows, that would save time and efforts.

P.S Edited my previous comments with single quotes in case other users may need this in the future :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.