#StackBounty: #chrome #xdg-open #xdg Custom URI handling: xdg-open and Firefox work, but Chrome doesn't

Bounty: 200

I’m trying to configure my Linux environment to open obsidian:// URIs using the Obsidian app (see Using Obsidian URI).

This is the flow I’m using. I’m doing this on a clean Ubuntu machine to make sure it reproduces:

  1. The Obsidian.AppImage file is stored in ~/obsidian alongside an icon.jpg file. The AppImage file has execute permissions.
  2. This is my ~/.local/share/applications/obsidian.desktop file’s content:
    [Desktop Entry]
    Name=Obsidian
    Exec=/home/rachum/obsidian/Obsidian.AppImage %u
    Terminal=false
    Type=Application
    Icon=/home/rachum/obsidian/icon.png  
    StartupWMClass=obsidian
    X-AppImage-Version=0.8.15
    Comment=Obsidian
    Categories=Office;
    MimeType=text/html;x-scheme-handler/obsidian;
    
  3. I’ve run update-desktop-database ~/.local/share/applications/
  4. Using xdg-open works as intended:
    xdg-open "obsidian://new?vault=notes&name=note&content=content"
    

    This command line opens the Obsidian app with the new note and content.

  5. In Firefox (preinstalled), typing the above URI into the URL bar also opens the Obsidian app with the new note and content.
  6. I installed Google Chrome by downloading the .deb file from the official Chrome site and running dpkg -i <.deb file>
  7. Typing the above URI in Chrome just redirects me to a Google search for "obsidian://new?vault=notes&name=note&content=content".

Why is Chrome not respecting the XDG configuration?


Update #1: adding more details to answer comment.

My ~/.local/share/applications/mimeapps.list file looks like this:

[Default Applications]
x-scheme-handler/obsidian=obsidian.desktop

My ~/.local/share/applications/mimeinfo.cache file looks like this:

[MIME Cache]
text/html=obsidian.desktop;
x-scheme-handler/obsidian=obsidian.desktop;


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.