Comment 60 for bug 1776873

Revision history for this message
Carlo Wood (carlo-alinoe) wrote :

Nevermind my last comment. This works in chromium (no idea about snapd).
To get this to work in chromium, first make sure it works for xdg-open.

Click on the link that you want to be opened automatically in some
application. When it downloaded, right-click on it (the button that
appeared on the bottom) and select "Always open files of this type";
this will cause chromium to use xdg-open next time you open a file
of that type.

To make xdg-open work, run "xdg-mime query filetype the-downloaded-file",
this should print the correct mime type.
Then run "xdg-mime query default that-mime-type", this should print
the desktop file that you want to use, aka "myapplication.desktop".
Inside that .desktop then (.local/share/applications/the-file.desktop),
there should be the lines Exec=/path/your/application and MimeType=that-mime-type
Anyway, plenty of tutorial on xdg on the net. I missed the chromium
trick to make it use xdg-open in the first place.