Ubuntu 22.04 links don't use default chrome browser

There have been previous answers which still don’t address this bug in the core obsidian for linux (namely ubuntu 22.04, gnome 42)

Repro

  • Set the default browser to chrome in the system settings
  • Open obsidian and follow an external link
  • Firefox launches instead of chrome (or google-chrome)

This likely is not a bug in Obsidian as it is not hard-coded to use a specific browser. It is the configuration of the operating system that determines what application is used.

I’ve detected the cause, and use symlink as a workaround:

Condition

  • OS: Ubuntu 22.04
  • Obsidian: 1.5.12 SNAP installed via Ubuntu Software
  • Default browser: Chrome set default for current $USER
  • Link destination opened from Obsidian: Firefox

Detection

  • Install obsidian-open-link-with plugin to manually open link in Chrome.
    • A strange looking browser appear
      => It must use different profile from $USER!
    • I checked profiles used in these 2 browser instances with the following results.
  • chrome://version/: Profile Path:
    • Normal browser used by $USER: $HOME/.config/google-chrome/Default
    • Strange browser used by Obsidian: $HOME/snap/obsidian/current/.config/google-chrome/Default
  • Conclusion: The Obsidian app uses a separate home dir placed in side SNAP ($HOME/snap/obsidian/current/), so all settings like .config/ and .local/ are separated from the $USER’s settings at $HOME.

Solution (workaround)

  • Remove the Chrome config (.config/google-chrome/) inside SNAP, if anny, then create a symlink to the normal Chrome config of $USER:
    ln -s ~/.config/google-chrome ~/snap/obsidian/current/.config/google-chrome
    

Additional info about the time I opened Chrome from Obsidian:

  • A strange looking browser appear and ask to set Chrome as default again
    => Seems like Obsidian’s invoking a brand new user different from the current $USER!
    => It must use different profile from current $USER!

duplicate of