Setting a snap of a browser as the default


We have several browser vendors working on snaps and a frequent question is how they can set the snap of their browser to be the users default?

Call for testing: chromium 61.0.3163.100

Last I looked, several browser were using something called xdg-settings which updates a file in a hidden dir on disk. What we would need is something like what we did for xdg-open: implement an xdg-settings that snaps have access to by default that talks to an out of process helper (eg dbus service), which is in a position to mediate the access (eg, throw up a confirmation dialog and do the operation on the snap’s behalf). Other applications edit ~/.config/mimeapps.list directly, so they would need to be modified to use xdg-settings.

In the meantime, it might be worth having documentation that says how to set the default browser outside of the snap.

UPDATE: I said “eg dbus”, but I meant the snapd session daemon that works with xdg-open (which is not dbus)

Unable to set default mail client - x-scheme-handler in snap .desktop files are ignored
Browser not setting itself as the default

I was reminded that this is covered by Browser not setting itself as the default