[snap] Chromium fails to set itself as default browser

Bug #1741078 reported by Olivier Tilloy on 2018-01-03
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Olivier Tilloy

Bug Description

When browsing to chrome://settings, the [Default browser] section shows the following message:

  Chromium cannot determine or set the default browser

and it doesn't allow setting itself as the default browser.

Note that setting the default webbrowser to the chromium snap from the outside does work:

    xdg-settings set default-web-browser chromium_chromium.desktop

Olivier Tilloy (osomon) wrote :

chromium invokes `xdg-settings get default-web-browser` to determine the default browser, and this is being blocked by apparmor.

If I add the following rule to /var/lib/snapd/apparmor/profiles/snap.chromium.chromium:

    /usr/bin/xdg-settings ixr,

chromium nows displays a different message, and a button to allow setting itself as default browser. However when clicking that button, I'm getting:

    Error org.freedesktop.DBus.Error.ServiceUnknown: The name io.snapcraft.Settings was not provided by any .service files

Olivier Tilloy (osomon) wrote :

snapd nows exposes a xdg-settings wrapper that bridges to the outside. However setting as the default browser now fails with the following error:

Error org.freedesktop.DBus.Error.Failed: cannot find desktop file "/var/lib/snapd/desktop/applications/chromium_chromium-browser.desktop"

snapd's xdg-settings wrapper prepends $SNAP_NAME + "_" to the desktop file name passed as a parameter. So chromium needs to be patched to pass "chromium.desktop" instead of "chromium-browser.desktop".

Changed in chromium-browser (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Medium → High
summary: - [snap] Chromium cannot determine or set the default browser
+ [snap] Chromium fails to set itself as default browser
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: Triaged → In Progress
status: In Progress → Fix Committed
Olivier Tilloy (osomon) on 2018-03-27
Changed in chromium-browser (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers