Obsidian doesn't use default browser on Ubuntu 22.04

I’m new to Obsidian. Switching over from Evernote, because they stopped working on their linux client.

I installed Obsidian via Snap and had the same issue as Obsidian does not open links in the standard browser on ubuntu

Obsidian always uses Firefoxe instead of the system default browser.

This doesn’t not happen if you use AppImage or install via dpk.

Don’t know if it’s a problem with snap in general or the way how the Obsidian snap was build.

6 Likes

I am not sure if Obsidian follows XDG specs, but could you try xdg-open https://example.org/ in your terminal? Anyways XDG is the only spec I know that should be respected by distros and linux apps in general. So, if xdg-open will open your default browser, this is indeed a bug.

I am not familiar with snap, does it containerize apps somehow? If yes, make sure that it has access to your system configuration about default browser.

And lastly, provide, how do you set your default browser? Do other apps respect your setting? Telegram for example, please provide examples of apps which respect your setting.

2 Likes

I can confirm that this is a bug – xdg-open uses Chrome. Obsidian opens things in Firefox.

In addition, I am running Ubuntu 20.04 and not using snap, so the bug does not appear to be specific to the Ubuntu version or to snap.

2 Likes

I can confirm this issue as well.

Same issue here, Obsidian always open firefox. xdg-open open chrome as well.

  • Obsidian 1.4.16
  • Ubuntu 22.04.3 LTS

For me it opened chromium even though I have firefox set as default browser. Running the following commands in the terminal (and then restarting Obsidian) made it work for me:

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

For using chrome as default browser it would be:

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

Got the solution from here: Default browser not used from within Snap? - #32 by onkeltem - snapd - snapcraft.io

1 Like

I have the same issue, also on Ubuntu 22.04.3 LTS, also installed via snap (if that matters).

I tried the solution suggested by gregmuellegger but unfortunately it didn’t work for me. I also followed the link in his post and tried the gio approach.

Obsidian indeed does not seem to respect my default browser, and I do not have the same problem with other desktop clients.

2 Likes

I am having the same issue, and the fix listed above didn’t work for me either.

Same issue here. I am on Ubuntu 23.10, it worked fine on Ubuntu 22.04. If I click a link in obsidian (v1.5.3) it always opens the link in firefox, but I have set google chrome as default browser, see screenshot below for Ubuntu Settings (Settings->“Default Apps”):

Also there is no issue when using xdg-open from command line. So this seems to be a bug in obsidian since xdg-open opens the url in google-chrome (the default browser). And the fix provided by above by gregmuellegger:

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

did not fix the problem.

1 Like

+1 having same issue on Ubuntu 23.10. Opera is set as default browser but all links open in firefox

+1 Same issue, Ubuntu 22.04.3, Obsidian v1.5.3, installer v1.4.16

+1 Same issue here, please fix!

+1, same problem. Obsidian v1.5.3, Ubuntu 22.04.3

BTW, instead of setting default mime type you can just query to check what is set for specific types: xdg-mime query default x-scheme-handler/https

I’ve got google-chrome.desktop so my default settings are as I wanted.

1 Like

+1, same problem here too. Obsidian 1.5.3, Ubuntu 22.04.

$ xdg-mime query default x-scheme-handler/https
brave-browser.desktop
$ xdg-mime query default x-scheme-handler/http
brave-browser.desktop

Links open up in Firefox when the default is Brave.

Same happens to me, links open with Firefox instead of Edge.
Os: Fedora release 39
Obsidian: 1.5.8
Tried the steps above related to setting xdg-mime but didn’t work.

hi. same issue on Ubuntu 22.04

I have a similar issue and hopefully a useful observation.
Ubuntu 22.04 with xfce4
Obsidian 1.5.8 installed as AppImage (it was also an issue with v 1.5.3)
Firefox installed as snap
xdg-open works from the command line.
obsidian fails when clicking a web link with, “Failed to execute default browser”.

I did have this working previously by removing the firefox snap and installing the Mozilla deb - and MUCH fiddling to get the default browser set correctly.

Unfortunately an update for Ubuntu reinstalled the snap, even though I had “pinned” the deb and my default settings were left in disarray. So I am no longer fighting the firefox snap, just trying to get it to work with obsidian.

All my other apps launch web links successfully as expected EXCEPT zathura (pdf viewer).
It threw exactly the same error.
Adding “set sandbox none” to the zathura config file resolved the issue.

thunderbird for example just worked.

Maybe this is a separate issue?

Chris

Replying to my own post.
I tracked down my issue. It was not due to Obsidian, so a different issue to this thread, but hopefully this may help someone.

I set “terminal=true” in my desktop launcher file and found that when trying to launch a web link I was getting a permission denied error on the “Path” folder in the desktop file.

I was the owner of that folder and also part of the group.
The permissions were 700.
I changed the “Path” to my home folder which has permissions 755 and it started working.

Chris

please ensure then you have set the your Mozilla Firefox as a default browser.

Failed:

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

Failed:

  • Change default app and then change it back again

Success:

  • uninstall snap and install deb package.