Firefox snap cannot be set as default browser under KDE

Bug #1967963 reported by Leonora Tindall
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Invalid
Low
Olivier Tilloy
Jammy
Invalid
Low
Olivier Tilloy
xdg-utils (Ubuntu)
Fix Released
Low
Olivier Tilloy
Jammy
Fix Released
Low
Olivier Tilloy

Bug Description

[Impact]

Minor.
This is a follow-up to bug #1970594. The original upstream merge request did fix the problem, but a misleading error message would be printed on stderr (which wasn't impacting firefox's ability to check whether it is the default browser). The upstream merge request has been updated to address this problem, and this SRU updates the corresponding patch to match the upstream MR (and what's in kinetic).

[Test Plan]

In Kubuntu 22.04, run the following command:

    xdg-settings check default-web-browser firefox_firefox.desktop

The only output should be "yes" (or "no" depending on your default browser setting) on stdout, and nothing on stderr. One can redirect stderr to a file to verify that.
The exit code of the command should be 0.

[Where problems could occur]

The patch is changing KDE-specific functions (check_browser_kde and check_url_scheme_handler_kde), so in theory it shouldn't affect running xdg-utils in any other desktop environment.

If the proposed patch is incorrect, it would affect the functionality of `xdg-settings check default-web-browser` and `xdg-settings check default-url-scheme-handler`, so this is what needs to be thoroughly tested in KDE.

[Original description]

I was unable to set Firefox as the default browser by going to Settings -> Applications -> Default Applications -> Web browser. It was set to Other... and web links opened in Kate.

In addition, I was unable to report a bug against Firefox because "it is provided by a snap provided by Mozilla."

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: xorg 1:7.7+23ubuntu2
ProcVersionSignature: Ubuntu 5.15.0-23.23-generic 5.15.27
Uname: Linux 5.15.0-23-generic x86_64
ApportVersion: 2.20.11-0ubuntu80
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: pass
CompositorRunning: None
CurrentDesktop: KDE
Date: Tue Apr 5 19:54:54 2022
DistUpgraded: Fresh install
DistroCodename: jammy
DistroVariant: ubuntu
ExtraDebuggingInterest: No
GraphicsCard:
 Intel Corporation UHD Graphics 620 [8086:5917] (rev 07) (prog-if 00 [VGA controller])
   Subsystem: Lenovo UHD Graphics 620 [17aa:225d]
InstallationDate: Installed on 2022-03-30 (6 days ago)
InstallationMedia: Kubuntu 22.04 LTS "Jammy Jellyfish" - Beta amd64 (20220329.1)
Lsusb:
 Bus 002 Device 002: ID 0bda:0316 Realtek Semiconductor Corp. Card Reader
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 003: ID 13d3:56a6 IMC Networks Integrated Camera
 Bus 001 Device 002: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: LENOVO 20L50067US
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/usr/bin/zsh
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.15.0-23-generic root=/dev/mapper/vgkubuntu-root ro quiet splash vt.handoff=7
SourcePackage: xorg
Symptom: display
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/20/2021
dmi.bios.release: 1.41
dmi.bios.vendor: LENOVO
dmi.bios.version: N24ET66W (1.41 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20L50067US
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40697 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.ec.firmware.release: 1.22
dmi.modalias: dmi:bvnLENOVO:bvrN24ET66W(1.41):bd10/20/2021:br1.41:efr1.22:svnLENOVO:pn20L50067US:pvrThinkPadT480:rvnLENOVO:rn20L50067US:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrNone:skuLENOVO_MT_20L5_BU_Think_FM_ThinkPadT480:
dmi.product.family: ThinkPad T480
dmi.product.name: 20L50067US
dmi.product.sku: LENOVO_MT_20L5_BU_Think_FM_ThinkPad T480
dmi.product.version: ThinkPad T480
dmi.sys.vendor: LENOVO
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.110-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 22.0.1-1ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx N/A
version.xserver-xorg-core: xserver-xorg-core 2:21.1.3-2ubuntu2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-2build3
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20210115-1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-2build1

Revision history for this message
Leonora Tindall (lfstindall) wrote :
affects: xorg (Ubuntu) → firefox (Ubuntu)
Revision history for this message
Sebastien Bacher (seb128) wrote :

The report suggests the desktop environment used is KDE. Under GNOME the settings correctly list firefox as a choice

Changed in firefox (Ubuntu):
importance: Undecided → Low
Revision history for this message
Leonora Tindall (lfstindall) wrote :

Is there a more appropriate place to file this bug? It's only a low priority if you consider all KDE-related issues low priority; for KDE users, I'd argue that it is a pretty high priority!

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
rolands11 (ubuntu-wr) wrote :

What has helped me is to set default browser in KDE settings:
System Settings > Applications > Default Applications > Web Browser

Revision history for this message
Olivier Tilloy (osomon) wrote :

Just tested this in a freshly installed Kubuntu 22.04 in a VM, and the firefox snap is set as the default browser, and I can change back and forth between it and other applications under System Settings > Applications > Default Applications > Web Browser.

Also verified that it is actually used as the default browser when invoking xdg-open.

Leonora, can you please report whether you're still seeing the problem?

Changed in firefox (Ubuntu):
status: Confirmed → Incomplete
summary: - Firefox snap cannot be set as default browser
+ Firefox snap cannot be set as default browser under KDE
Revision history for this message
fantasai (fantasai) wrote :

I have the same problem in Xubuntu, fwiw. Firefox is unable to set itself as the default browser no matter how many times I restart it and click "Set as Default Browser" in its settings menu or its pop-up reminders complaining that it's not the default. And clicking on links in Thunderbird opens up in Chrome. However XFCE settings *thinks* it's the default, if I open it up and look.

I eventually gave up and re-installed via apt using the mozilla.org repo, and that version has no problem setting itself as default, so it's clearly a snap packaging problem.

Revision history for this message
Evgenii Shatokhin (euspectre) wrote :

Kubuntu 22.04, updated yesterday from 20.04 on Acer E15 laptop.

Same issue: each time I start Firefox, it complains it is not the default browser. I click "Set as Default Browser" but the next time I start Firefox, it complains again, the same way.

I tried marking Firefox as default in the browser settings too - no effect.

$ snap info firefox
name: firefox
summary: Mozilla Firefox web browser
publisher: Mozilla✓
store-url: https://snapcraft.io/firefox
contact: https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla
license: unset
description: |
  Firefox is a powerful, extensible web browser with support for modern web application
  technologies.
commands:
  - firefox
snap-id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
tracking: latest/stable
refresh-date: yesterday at 19:45 MSK
channels:
  latest/stable: 100.0-2 2022-05-05 (1300) 168MB -
  latest/candidate: 100.0-2 2022-05-02 (1300) 168MB -
  latest/beta: 101.0b2-1 2022-05-04 (1313) 169MB -
  latest/edge: 102.0a1 2022-05-08 (1322) 179MB -
  esr/stable: 91.9.0esr-1 2022-05-05 (1284) 161MB -
  esr/candidate: 91.9.0esr-1 2022-04-27 (1284) 161MB -
  esr/beta: ↑
  esr/edge: ↑
installed: 100.0-2 (1300) 168MB -

Revision history for this message
Evgenii Shatokhin (euspectre) wrote :

In the system settings (KDE), Firefox is listed as the default browser, but that seems to have no effect.

Revision history for this message
Evgenii Shatokhin (euspectre) wrote :

I have tried removing Firefox snap and installing the deb package from ppa:mozillateam/ppa as described at https://ubuntuhandbook.org/index.php/2022/04/install-firefox-deb-ubuntu-22-04/.

The variant from PPA does not have the issue in Kubuntu 22.04, it seems. Firefox was set as default browser successfully then and works OK for me.

Revision history for this message
Ravindra Gullapalli (sharewithravig) wrote :

@euspectre - Thank you. That worked.

Revision history for this message
Elvis Stansvik (elvstone) wrote :

I had this problem and the attached patch for xdg-settings worked for me (see my comment at https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/52#note_1488548).

With this, the Firefox snap recognizes itself as the default browser for me (Kubuntu 22.04), whereas previously it would not.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix comparison (== is not a valid operator in Dash)" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Olivier Tilloy (osomon)
Changed in firefox (Ubuntu):
status: Incomplete → Fix Released
assignee: nobody → Olivier Tilloy (osomon)
Changed in firefox (Ubuntu Jammy):
assignee: nobody → Olivier Tilloy (osomon)
status: New → In Progress
importance: Undecided → Low
Olivier Tilloy (osomon)
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Leonora, or anyone else affected,

Accepted xdg-utils into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/xdg-utils/1.1.3-4.1ubuntu3~22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-jammy
Changed in xdg-utils (Ubuntu):
status: New → Fix Released
Changed in xdg-utils (Ubuntu Jammy):
status: New → In Progress
Changed in firefox (Ubuntu):
status: Fix Released → Invalid
Changed in firefox (Ubuntu Jammy):
status: In Progress → Invalid
Olivier Tilloy (osomon)
Changed in xdg-utils (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
Changed in xdg-utils (Ubuntu Jammy):
assignee: nobody → Olivier Tilloy (osomon)
Changed in xdg-utils (Ubuntu):
importance: Undecided → Low
Changed in xdg-utils (Ubuntu Jammy):
importance: Undecided → Low
status: In Progress → Fix Committed
Revision history for this message
Olivier Tilloy (osomon) wrote :

I ran the test plan ("xdg-settings check default-web-browser firefox_firefox.desktop") in a fully up-to-date Kubuntu 22.04 VM, first without the update from jammy-proposed (xdg-utils 1.1.3-4.1ubuntu3~22.04.1), and then with it.

I can confirm that with the update, the extraneous output on stderr is gone. The functionality itself isn't impacted.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-utils - 1.1.3-4.1ubuntu3~22.04.1

---------------
xdg-utils (1.1.3-4.1ubuntu3~22.04.1) jammy; urgency=medium

  * Update a distro patch from the corresponding upstream merge request
    (LP: #1967963)
    - debian/patches/upstream-mr-remove-bashisms.patch

 -- Olivier Tilloy <email address hidden> Mon, 22 Aug 2022 16:47:45 +0200

Changed in xdg-utils (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for xdg-utils has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.