Obsidian doesn't use default browser on Ubuntu / Snap

Hi there,

Ubuntu 20.4 and it opens any external link in a blank stance of my browser, with a whole new profile under obsidian window.

I tried already with no change to install the deb.

Checked before it the default browser on the system was ok…

I can confirm this is happening to me as well, using the Obsidian snap and Vivaldi browser

Managed to get a bit more info.

I launched obsidian from the command line so that I could watch the terminal output when I tried to open a link. Here’s what I see when I click on the link:

Opening URL: https://google.com/
cat: standard output: Bad file descriptor
[12258:12258:0905/175038.155830:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.

Hopefully this helps.

I was able to fix this for myself, but I’m not sure what caused it in the first place so I’m not sure how permanent the fix is or whether it’s even the same problem many of you are experiencing. So, apologies if this is not useful for you.

I’m using Ubuntu 22.04 with KDE and the appimage version of Obsidian (1.4.12) and external links were opening in Konqueror despite (the snap version of) Firefox being my default browser. No other app was causing this behavior.

I also installed the deb version of Obsidian with the same result, but got this on the console.
> org.kde.kfmclient: External browser service not known: "firefox_firefox.desktop"

kreadconfig5 reported Firefox (firefox_firefox.desktop) as my default browser as did xdg-settings. However, when I went to the GUI for System Settings, it strangely reported Konqueror. I set this to Firefox and it worked in Obsidian.

I believe I originally set my default browser through Firefox’s prompt to be the default browser. My best guess is that Firefox did not do this correctly, so it was only partially set as my default browser.

Edit: Just to add, this fixed the problem for me in both the appimage version and the deb version. I have not tried the snap version.

Take a look to this tiny program , maybe it can help.

Simply assigns different protocols to different browsers

I see that various reports about this are scattered around the forum. I merged together.

It seems that this problem affects specifically the snap package. We have recently updated the app we use to build the snap package.

Does this problem still happen with a new snap of Obsidian 1.6.5?

Yes, this problem still happens with the new snap of Obsidian 1.6.5 on the latest Ubuntu 24.04 LTS.

Here are the details of the Obsidian snap I tested with:

Name      Version  Rev  Tracking       Publisher   Notes
obsidian  1.6.5    34   latest/stable  obsidianmd  classic

does running these commands from the shell solve the problem?

xdg-mime default google-chrome.desktop x-scheme-handler/http
xdg-mime default google-chrome.desktop x-scheme-handler/https

substitute chrome with whatever your default browser is

I tried the commands and restarted Obsidian to test: it did not solve the problem or change the result: a google chrome window with a separate profile opens with the page. For me, google-chrome.desktop was already the XDG default for those mime types when I ran the query commands. Thanks for the suggestion!

+1 still an issue on Ubuntu 24.04. LTS and Obsidian 1.6.7 from Snap

Having an issue with this.

Ubuntu 24.04.1
Obsidian 1.6.7 (Snap version)

Default system browser is Firefox and Obsidian opens links with Chromium

Confirmed
same issue with:

Pop!_OS 22.04 LTS
Obsidian 1.6.7 (Snap version)
xdg setup correctly, but this obsidian snap doesn’t respect xdg and defaults to Firefox

Solution :slightly_smiling_face:

purge obsidian snap, install obsidian flatpak

First command below possibly not necessary, it zips obsidian snap settings directory as it’s obliterated after removing the snap. Oh, found you can change your location where /snap/obsidian is installed (aka homedirs), by default it will be “$HOME/snap/obsidian”. Also, you can set your homedirs to a root directory?! Of course that’s not advised! What you run all installed snaps as root?? Solution is straightforward after that.

zip -r "$HOME/obsidian.zip" "`sudo snap get system homedirs 2> /dev/null || echo $HOME`/snap/obsidian"

sudo snap remove --purge obsidian
sudo apt update
flatpak install flathub md.obsidian.Obsidian

Confirmed
Correct browser used from obsidian flatpak

For me chrome was always opened instead of my default firefox. I use the Appimage under Ubuntu 24 and tried:

xdg-mime default firefox.desktop x-scheme-handler/http
xdg-mime default firefox.desktop x-scheme-handler/https

but that didnt help, what did help was:

xdg-mime default firefox_firefox.desktop x-scheme-handler/http
xdg-mime default firefox_firefox.desktop x-scheme-handler/https

Hope that helps someone. No sure why the desktop files have this strange naming. Looking into ~/.config/mimeapps.list gave me the idea.