Closed Bug 420408 Opened 17 years ago Closed 2 months ago

Firefox does not set itself as default browser correctly on Gnome/Linux

Categories

(Firefox :: Shell Integration, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: mozilla, Assigned: mpohle)

References

()

Details

Attachments

(2 files)

(Spotted on Ubuntu Hardy (8.04 development branch) using the latest trunk nightly from Mozilla.) When Firefox sets itself as the default browser on Gnome, the command it uses to invoke itself is: /path/to/firefox "%s" Then, when Firefox is invoked from the keyboard shortcut (set in Gnome's System → Preferences → Keyboard Shortcuts), Firefox loads the user's home folder as a directory listing (i.e. it loads file:///home/example/ ). Instead, Firefox should open a new window, as if it had been invoked from the Applications menu or a launcher. This can be achieved by changing the command used to invoke Firefox from the above to: /path/to/firefox %s i.e. by removing the quotation marks (users can do this in System → Preferences → Preferred Applications → Internet). The in-built version of Firefox in Ubuntu invokes itself using: firefox %s so removing the quotes shouldn't have any unforeseen repercussions. So: Firefox should register itself as the default browser using: /path/to/firefox %s instead of /path/to/firefox "%s" (I suppose other distros will also set this command themselves for the Firefoxen they distribute, which is why I've set this bug's severity to minor. I also reported this to Launchpad; detailed steps to reproduce are at https://bugs.launchpad.net/bugs/196493 )
I am interested to work on this bug and I would I like to know more details about this bug. I would also like to know where I should get started.
olsolete and resolved if set as default from preferences, firefox (from mozilla) creates ~/.local/share/applications/userapp-Firefox-RANDOM.desktop with Exec=/path/to/firefox %u

Hello,

This issue still occurs in 76.0b8 with Ubuntu 18.04 . Upon clicking the "Make default..." button , the browser is not saved as default and the following error is triggered inside the browser console:

[Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIShellService.setDefaultBrowser]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: chrome://browser/content/preferences/in-content/main.js :: setDefaultBrowser :: line 1305" data: no] main.js:1305:18 setDefaultBrowser chrome://browser/content/preferences/in-content/main.js:1305 setDefaultBrowser self-hosted:844

See Also: → 1637357
Severity: minor → S4

I am still able to reproduce this issue on Firefox 115.12.0-esr, using Ubuntu 22.04, as mentioned in Comment 3.

Desktop QA has been highlighting this defect as a known issue for several release cycles now, following regression testing. Max, it would really help us if you set a priority on this bug — it will give us clarity on whether this issue is still worth mentioning in future test reports.

Flags: needinfo?(mpohle)
Flags: needinfo?(mpohle)
Priority: -- → P3
Assignee: nobody → mpohle

Hi! I was unable to reproduce this bug. I tried the (snap build, which comes pre-installed on 20.04) with its desktop file under /var/lib/snapd/desktop/applications/firefox_firefox.desktop and also the .deb-package provided by us (as described here), which created a desktop file for me under ~/.local/share/applications/. Both use %u (without quotes) and do not show the home folder when I use my custom shortcut (see screenshot).

If this is indeed still an issue for you, I need more info:

  • Which version did you try?
  • Have you used another approach to configure the shortcut?
  • Can you record a short video clip of this problem happening?
Flags: needinfo?(avaida)

Hi Max,
Indeed, the issue no longer reproduces when installing the Firefox builds on Ubuntu 22.04 as advised via the link you provided (snap, deb, and tar.bz2 builds).

However, I have noticed that the reason why I was unable to set the Firefox browser as the default one is because I manually extracted the tar.bz2 file into a folder with a name containing spaces (e.g., 'new folder').
This can be reproduced with Firefox 128.0-build1 RC or latest Firefox Nightly 129.0a1 (2024-07-03). Upon clicking the "Make default..." button from about:preferences, the browser is not saved as default and and the error mentioned in Comment 3 is displayed in the browser console.

I am attaching a video as well.

Could you please let me know if this is expected? Thank you in advance!

Flags: needinfo?(avaida) → needinfo?(mpohle)

Hey bhidecuti! Good catch! I am going to discuss with the team if we want to have a dedicated bug for that or if we can simply fix it within this Bug. I will come back to this after having done that and will leave the needinfo on me until then.

This bug was about the quotes as in /path/to/firefox "%s", which is the same fix as suggested in Bug 382174. Now that this issue is no more we can address the issue with the path name if it contains spaces somewhere else and mark these two bugs as fixed.

I will create such a bug and close these as resolved. I am going to link the newly created bug here afterwards.

Status: NEW → RESOLVED
Closed: 2 months ago
Flags: needinfo?(mpohle)
Resolution: --- → FIXED

The problem with path names with spaces in it can be further discussed in Bug 1917286. Thanks Bianca Hidecuti for pointing it out!

See Also: → 1917286
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: