Default Browser doesn't work when set to Brave (flatpak)

I’ve been using Vivaldi for awhile and decided to switch back to Brave. I installed Brave via flatpak and opened Default Applications and chose Brave. However, if I click on the Web Browser icon I get the following error:

I’m able to launch Brave from its own application icon. Can someone help me understand if I’ve done something wrong? Thank you!

Flatpak does not always create desktop launchers.

You can work around it by creating one manually /usr/share/application named brave.dsktop.

$ cat /usr/share/applications/brave.desktop
[Desktop Entry]
Version=1.0
Name=Google Chrome
GenericName=Web Browser
Comment=Access the Internet
StartupWMClass=Google-chrome
Exec=/usr/bin/flatpak run com.brave.Browser %u
StartupNotify=true
Terminal=false
Icon=google-chrome
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;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
StartupWMClass=Google-chrome
Exec=/usr/bin/flatpak run com.brave.Browser

[Desktop Action new-private-window]
Name=New Incognito Window
StartupWMClass=Google-chrome
Exec=/usr/bin/flatpak run com.brave.Browser --incognito

Then set the default browser - which is done using below commands - where $1 is your browser’s launcher e.g. firefox.desktop or in your case you newly created brave.desktop

xdg-mime default "$1" x-scheme-handler/https
xdg-mime default "$1" x-scheme-handler/http
xdg-settings set default-web-browser $1

As developer I have need to switch default browser easily - so I created a small utility script

1 Like

I use brave-bin from the AUR and it all works fine. I’m not keen on things like Snap and Flatpak.

1 Like