pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.44k stars 87 forks source link

POP OS 22.04 Firefox Cannot Be Set to Default Application for Web #2314

Open ganakee opened 2 years ago

ganakee commented 2 years ago

cat /etc/os-release NAME="Pop!_OS" VERSION="22.04 LTS" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 22.04 LTS" VERSION_ID="22.04" HOME_URL="https://pop.system76.com" SUPPORT_URL="https://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=jammy UBUNTU_CODENAME=jammy LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME): apt policy firefox firefox: Installed: 99.0.1~1650375484~22.04~89704bc Candidate: 99.0.1~1650375484~22.04~89704bc Version table: 1:1snap1-0ubuntu2 500 500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages *** 99.0.1~1650375484~22.04~89704bc 1001 1001 http://apt.pop-os.org/release jammy/main amd64 Packages 100 /var/lib/dpkg/status

Issue/Bug Description: After upgrade to POP OS 22.04, Firefox and Settings...Default Applications does not recognize Firefox as being the default browser and asks for browser check each launch of Firefox.

Steps to reproduce (if you know): Upgrade from POP OS 21.10 to 22.04. Open Firefox. Firefox Check Default Application dialogue appears asking to set Firefox as the default browser. Select DEFAULT (yes). Close Firefox. Open Firefox. Firefox again asks to be set as default. SEE OTHER NOTES.

Expected behavior: POP OS Default Applications records Firefox properly.

Other Notes: Setting Default Applications does not seem to register Firefox properly after upgrade. I attach some screen shots. Default Applications seems to have a Firefox entry (using a default icon) AND a Firefox Web Browser (with Firefox icon). I am not sure if this is the source of the issue or related. But, in Settings Default Applications, if you click the Web Drop down you get three entries--Firefox Thunderbird and then Firefox Web Browser. For some reason, even after manually setting the Default Application in Settings Default Applications, Firefox still requests on each opening.

![Mod Screenshot from 2022-04-27 12-05-19](https://user-images.githubusercontent.com/23140586/165564716-4ebad660-60a1-4846-b9e4-d7610e46c0 Screenshot from 2022-04-27 12-04-40 3e.png) Screenshot from 2022-04-27 12-17-22

Mod Screenshot from 2022-04-27 12-05-19

linuxgnuru commented 2 years ago

We don't maintain the snap version of the firefox package; if you install the deb or flatpak version do you get the same issue?

rhanneken commented 2 years ago

We don't maintain the snap version of the firefox package; if you install the deb or flatpak version do you get the same issue?

I have the same issue, ,and I have the deb package installed.

When Firefox asks me if I want to make it my default browser, and I say yes, the default application is set to the "Firefox" entry with a gear icon. That actually does cause Firefox to be the default browser.

When I do apt policy firefox, I get the same output that the original poster did.

I upgraded to 22.04 from 21.10 yesterday.

ganakee commented 2 years ago

I have had the APT version installed via apt. (I do see 1snap1 in the information but I never installed a snap version. I avoid flatpaks if at all possible so this is an apt/deb version.

I ran

 apt policy firefox
firefox:
  Installed: 99.0.1~1650375484~22.04~89704bc
  Candidate: 99.0.1~1650375484~22.04~89704bc
  Version table:
     1:1snap1-0ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
 *** 99.0.1~1650375484~22.04~89704bc 1001
       1001 http://apt.pop-os.org/release jammy/main amd64 Packages
        100 /var/lib/dpkg/status

The problem persists and started with the upgrade from POP OS 21.10 to 22.04. I have set the default within firefox in response to the prompt on launch, and tried to do so via Firefox Settings. I verify that GNOME Settings...Default Applications shows two entries for firefox--the gears version (which is what gets set within firefox) and the firefox logo version. However, if you set to either version in GNOME settings manually, the problem occurs in firefox on next launch.

linuxgnuru commented 2 years ago

Does it ask for default browser all the time or just the 2nd time started after an update?

rhanneken commented 2 years ago

Does it ask for default browser all the time or just the 2nd time started after an update?

Every time Firefox starts. I can start Firefox by clicking on a link in another application, which makes it seem like Firefox is the default browser. But Firefox doesn't seem to recognize that.

ganakee commented 2 years ago

Good question @linuxgnuru I concur with @rhanneken but add the following to show a nuance of "every time Firefox starts." For me, the issue occurs with a new (fresh), sole, instance launch of Firefox. See examples to show the nuance.

The prompt occurs with every new launch of Firefox. By new launch I mean launching initially from Applications or Dash with a new, single instance of Firefox Example: Boot computer. Launch Firefox--prompt.

Boot computer. Launch Firefox--prompt. ReBoot computer. Launch Firefox--prompt.

Boot computer. Launch Firefox--prompt. Logout. Login. Launch Firefox--prompt.

NOTE THIS ONE AS DISTINGUISHING FROM THE FOLLOWING EXAMPLES Boot computer. Launch Firefox--prompt. Close Firefox. (All instances closed). Launch Firefox--prompt.

HOWEVER, if Firefox has an open instance, then the prompt does not occur for subsequent instances as long as the initial instance remains open (for me).

Example: Boot computer. Launch Firefox--prompt occurs. With that instance of Firefox still open, navigate to a webpage with a link in the webpage (DuckDuckGo for example) in the open instance of Firefox Right-click link and select open in new window-- NO PROMPT.

Boot computer. Launch Firefox--prompt occurs. With that instance of Firefox open, navigate to a webpage in first instance. Then from dash (Firefox is in my dash) or Applications, right-click the Firefox icon and select Open New Window [of Firefox]--NO PROMPT.

I confirm that the same issue occurs on two different computers (one a desktop and one a laptop) both now running 22.04. and upgraded from 21.10. Same issue.

linuxgnuru commented 2 years ago

Could you have a terminal with the following command running and then run firefox and paste the output from the terminal?

sudo journalctl -f -t firefox.desktop

ganakee commented 2 years ago

I copy the output below. Thank you. I opened then closed Firefox twice. I ran this from my laptop and hope to run from the desktop tomorrow.

sudo journalctl -f -t firefox.desktop

Apr 27 22:47:50 campo-pop-os firefox.desktop[8799]: ###!!! [Parent][PImageBridgeParent] Error: RunMessage(msgname=PImageBridge::Msg_WillClose) Channel closing: too late to send/recv, messages will be lost
Apr 27 22:52:10 campo-pop-os firefox.desktop[11292]: ATTENTION: default value of option mesa_glthread overridden by environment.
Apr 27 22:52:40 campo-pop-os firefox.desktop[11526]: (/usr/lib/firefox/firefox-bin:11526): dconf-WARNING **: 22:52:40.888: Unable to open /var/lib/flatpak/exports/share/dconf/profile/user: Permission denied
Apr 27 22:56:57 campo-pop-os firefox.desktop[11292]: ###!!! [Parent][PImageBridgeParent] Error: RunMessage(msgname=PImageBridge::Msg_WillClose) Channel closing: too late to send/recv, messages will be lost
Apr 27 22:57:06 campo-pop-os firefox.desktop[11848]: ATTENTION: default value of option mesa_glthread overridden by environment.
-- Boot 023826711ae74402b60b95e08758eb20 --
Apr 28 21:38:03 campo-pop-os firefox.desktop[4290]: ATTENTION: default value of option mesa_glthread overridden by environment.
Apr 28 22:08:33 campo-pop-os firefox.desktop[20654]: ATTENTION: default value of option mesa_glthread overridden by environment.
Apr 28 22:09:10 campo-pop-os firefox.desktop[20654]: ATTENTION: default value of option mesa_glthread overridden by environment.
Apr 28 22:09:29 campo-pop-os firefox.desktop[20654]: ATTENTION: default value of option mesa_glthread overridden by environment.
Apr 28 22:09:44 campo-pop-os firefox.desktop[20654]: ###!!! [Parent][PImageBridgeParent] Error: RunMessage(msgname=PImageBridge::Msg_WillClose) Channel closing: too late to send/recv, messages will be lost
-- Boot 40937b09afd64934815252d504dcdb8d --
Apr 29 20:52:22 campo-pop-os firefox.desktop[4131]: ATTENTION: default value of option mesa_glthread overridden by environment.
ganakee commented 2 years ago

I saw a mention of flatpak in the output above. I did not think that the Firefox install was a flatpak install. I ran flatpak list to show that Firefox is not installed as a Flatpak.

Name                         Application ID                             Version    Branch     Installation
Freedesktop Platform         org.freedesktop.Platform                   21.08.12   21.08      user
Mesa                         org.freedesktop.Platform.GL.default        21.3.8     21.08      user
Intel                        org.freedesktop.Platform.VAAPI.Intel                  21.08      user
openh264                     org.freedesktop.Platform.openh264          2.1.0      2.0        user
GNOME Application Platform … org.gnome.Platform                                    42         user
Weather                      org.gnome.Weather                          42.0       stable     user
Pop Gtk theme                org.gtk.Gtk3theme.Pop-dark                            3.22       user
KDE Application Platform     org.kde.Platform                                      5.15-21.08 user
QGnomePlatform               org.kde.PlatformTheme.QGnomePlatform                  5.15-21.08 user
QtSNI                        org.kde.PlatformTheme.QtSNI                           5.15-21.08 user
QGnomePlatform-decoration    …ylandDecoration.QGnomePlatform-decoration            5.15-21.08 user
ganakee commented 2 years ago

I noticed something else today. On a fresh boot, I opened GNOME Settings Default Apps before anything else. The web was set to Thunderbird and not Firefox (neither the gear-icon or the Firefox-logo icon version).

ganakee commented 2 years ago

Some more details. The problem on 2022-05-03 is still occurring (I am just saying this to avoid confusion, not as pressure). I thought the recent updates fixed part of the problem but I was wrong. The issue still occurs just as described above. The recent POP OS updates did not appear to positively affect the issue.

*If you click a link in an email (which would open a browser), the prompt still occurs. The case for this is: No browser open. Open Thunderbird. Click on a link in an email. Firefox opens but shows the default prompt. All subsequent attempts to open an email link fail to open Firefox at all.

I ran the sudo journalctl -f -t firefox.desktopcommand and the following occurs:**

sudo journalctl -f -t firefox.desktop
[sudo] password for: 
May 02 09:11:05 foggy-pop-os firefox.desktop[7541]: [2022-05-02T13:11:05Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 09:11:48 foggy-pop-os firefox.desktop[7773]: [2022-05-02T13:11:48Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 09:11:48 foggy-pop-os firefox.desktop[7773]: [2022-05-02T13:11:48Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 09:11:48 foggy-pop-os firefox.desktop[7773]: [2022-05-02T13:11:48Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 09:11:48 foggy-pop-os firefox.desktop[7773]: [2022-05-02T13:11:48Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 10:13:37 foggy-pop-os firefox.desktop[8452]: [2022-05-02T14:13:37Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 10:13:37 foggy-pop-os firefox.desktop[8452]: [2022-05-02T14:13:37Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 10:13:37 foggy-pop-os firefox.desktop[8452]: [2022-05-02T14:13:37Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 10:13:37 foggy-pop-os firefox.desktop[8452]: [2022-05-02T14:13:37Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
May 02 10:13:47 foggy-pop-os firefox.desktop[6724]: ###!!! [Parent][PImageBridgeParent] Error: RunMessage(msgname=PImageBridge::Msg_WillClose) Channel closing: too late to send/recv, messages will be lost
ganakee commented 2 years ago

On the laptop, the issue occurs every time Firefox launches even after the recent POP OS updates.

sudo journalctl -f -t firefox.desktop
[sudo] password for: 
May 01 22:32:07 campo-pop-os firefox.desktop[13527]: ###!!! [Child][PContentChild] Error: RunMessage(msgname=PContent::Msg_DiscardWindowContext) Channel closing: too late to send/recv, messages will be lost
May 01 22:32:07 campo-pop-os firefox.desktop[13527]: ###!!! [Child][PContentChild] Error: RunMessage(msgname=PContent::Reply_DiscardBrowsingContext) Channel closing: too late to send/recv, messages will be lost
May 01 22:32:07 campo-pop-os firefox.desktop[13348]: ###!!! [Child][PContentChild] Error: RunMessage(msgname=PContent::Msg_DestroyBrowsingContextGroup) Channel closing: too late to send/recv, messages will be lost
May 01 22:32:07 campo-pop-os firefox.desktop[13348]: ###!!! [Child][PContentChild] Error: RunMessage(msgname=PContent::Msg_DestroyBrowsingContextGroup) Channel closing: too late to send/recv, messages will be lost
May 01 22:32:07 campo-pop-os firefox.desktop[13348]: ###!!! [Child][PContentChild] Error: RunMessage(msgname=PContent::Msg_DestroyBrowsingContextGroup) Channel closing: too late to send/recv, messages will be lost
May 01 22:32:07 campo-pop-os firefox.desktop[13348]: ###!!! [Child][PContentChild] Error: RunMessage(msgname=PContent::Msg_DestroyBrowsingContextGroup) Channel closing: too late to send/recv, messages will be lost
May 01 22:32:07 campo-pop-os firefox.desktop[13348]: ###!!! [Child][PContentChild] Error: RunMessage(msgname=PContent::Msg_DestroyBrowsingContextGroup) Channel closing: too late to send/recv, messages will be lost
May 01 22:32:07 campo-pop-os firefox.desktop[13000]: ###!!! [Parent][PImageBridgeParent] Error: RunMessage(msgname=PImageBridge::Msg_WillClose) Channel closing: too late to send/recv, messages will be lost
-- Boot 57110dfb3cd740088b57ee6007add3b8 --
May 02 20:01:12 campo-pop-os firefox.desktop[5157]: ATTENTION: default value of option mesa_glthread overridden by environment.
May 02 20:01:24 campo-pop-os firefox.desktop[5157]: ###!!! [Parent][PImageBridgeParent] Error: RunMessage(msgname=PImageBridge::Msg_WillClose) Channel closing: too late to send/recv, messages will be lost
rhanneken commented 2 years ago

Can someone who does not have this problem please tell me:

  1. What is the output of this command: grep '^Exec=' /usr/share/applications/firefox.desktop
  2. If you visit the about:support page in Firefox (you can access it in the menu under Help→More troubleshooting information), what is listed for "Application Binary" (in the "Application Basics" table)?
senntore commented 2 years ago

Can someone who does not have this problem please tell me:

1. What is the output of this command: `grep '^Exec=' /usr/share/applications/firefox.desktop`

2. If you visit the `about:support` page in Firefox (you can access it in the menu under Help→More troubleshooting information), what is listed for "Application Binary" (in the "Application Basics" table)?
  1. Exec=firefox %u Exec=firefox -new-window Exec=firefox -private-window
  2. /usr/lib/firefox/firefox-bin

Firefox did asked me to set it as the default browser even though it already was, but I set it anyway(which created userapp-Firefox-FKX7K1.desktop ) & it's working as usual afterward

rhanneken commented 2 years ago

@senntore Since you did that, have you closed all the browser windows and restarted Firefox?

senntore commented 2 years ago

@rhanneken yes, it's been days since I did that & ofcourse with a lot of reboot in between along with restart of firefox Here is the screenshot of it being the default browser Screenshot from 2022-05-04d .

rhanneken commented 2 years ago

@senntore If you close all Firefox windows, and then click on a link in another application, does Firefox prompt you to make it the default browser?

senntore commented 2 years ago

@rhanneken I tested with links from a pdf but Firefox didn't prompt me for default browser stuff.

linuxgnuru commented 2 years ago

Firefox 100 just got pushed; see if the update fixes things

rhanneken commented 2 years ago

Firefox 100 just got pushed; see if the update fixes things

No, I still have the same issue with Firefox 100.

ganakee commented 2 years ago

I do not appear to see this problem consistently with v.100. I do seem to see it erratically now (not every time).

I ran

grep '^Exec=' /usr/share/applications/firefox.desktop
Exec=firefox %u
Exec=firefox -new-window
Exec=firefox -private-window

Firefox...Help...More troubleshooting information... Application Binary /usr/lib/firefox/firefox-bin

linuxgnuru commented 2 years ago

In Settings ->Default Applications is firefox with the gear icon selected or the firefox with the firefox icon? The gear option should be the one selected to not see the option to set firefox as default.

ganakee commented 2 years ago

On my laptop, yes, the gear-icon firefox is selected.

linuxgnuru commented 2 years ago

Could you see if following the instructions in the link below fixes things?

https://bugzilla.mozilla.org/show_bug.cgi?id=1455572

linuxgnuru commented 2 years ago

Looks like this bug will be fixed in Thunderbird v 101

Raekye commented 2 years ago

Hello,

I'm having this issue with a new system76 laptop with Pop!_OS 22.04. Whenever I open a new firefox instance (all windows were previously closed) it prompts me to set itself as the default browser.

I have the default firefox that came with the laptop, which is the apt package. I do not have thunderbird installed.

# apt policy firefox
firefox:
  Installed: 102.0.1~1657309964~22.04~d14d793
  Candidate: 102.0.1~1657309964~22.04~d14d793
  Version table:
     1:1snap1-0ubuntu2 500
        500 http://apt.pop-os.org/ubuntu jammy/main amd64 Packages
 *** 102.0.1~1657309964~22.04~d14d793 1001
       1001 http://apt.pop-os.org/release jammy/main amd64 Packages
        100 /var/lib/dpkg/status

Querying flatpak list doesn't show any firefox.

Settings -> Default Applications lists "Firefox Web Browser" for "Web". There are no other options if I click the dropdown.

If I open a link, e.g. Settings -> Support -> Documentation -> Browse, it opens firefox.

xdg-open https://google.com opens the link in firefox similarly.

xdg-settings check default-web-browser firefox.desktop returns yes.

Output of grep '^Exec=' /usr/share/applications/firefox.desktop:

Exec=firefox %u
Exec=firefox -new-window
Exec=firefox -private-window

Firefox's about:support page has /usr/lib/firefox/firefox-bin as the "Application Binary".

Output of sudo journalctl -f -t firefox.desktop after closing all firefox instances and launching firefox from the dock:

Jul 21 18:49:10 pop-os firefox.desktop[66462]: ATTENTION: default value of option mesa_glthread overridden by environment.
Jul 21 18:49:10 pop-os firefox.desktop[66462]: ATTENTION: default value of option mesa_glthread overridden by environment.
Jul 21 18:49:10 pop-os firefox.desktop[66462]: ATTENTION: default value of option mesa_glthread overridden by environment.
Jul 21 18:49:10 pop-os firefox.desktop[66462]: ATTENTION: default value of option mesa_glthread overridden by environment.

I have not tried letting firefox set itself as the default browser, as it bugs me why this is happening :( (and it might go away without me figuring out why if I let it set itself)

mmstick commented 2 years ago

Let firefox set itself as the default web browser

Raekye commented 2 years ago

Other than the end result of the prompt goes away or doesn't, is there anything I can look for? Like some config file being created or modified...

Edit: One thing I really like about linux is everything can be configured through a file... if you know where to look. UIs doing mysterious things is one thing I don't like about windows :(

BattleRefrigerator commented 1 year ago

I'm having a similar problem. i installed Firefox via flatpak and uninstalled the version shipped with pop!_os, now when Opening any links in other aplications will prompt

Your Firefox profile cannot be loaded. It may be missing or inaccessible.

Trying to set it default via the settings lags the browser a little bit and does nothing.

It caught my attention that in settings>Your browser is being managed by your organization. it says that DontCheckDefaultBrowser is set to true. maybe this has to do something with the problem ?

gojo-limitless commented 1 year ago

I can confirm that the issue continues to occur. I had a different browser set as default.

When I switched back to Firefox, and set it as the default, the default application list shows it as a new entry (with a gear icon) as per the screenshot described in this issue.

The entry with Firefox's icon remains separate, and when you select that instead, the Firefox browser no longer remains the default.

spacepowder commented 3 months ago

New Pop!_OS user here, and I too have two entries/icons under the default applications for Web; a gear icon (the one that's currently being used) and a regular Firefox icon. If I set it to the one with a normal icon, then Firefox (which I have verified is the only one I have installed, native/system) says that it isn't my default browser.

philg-dev commented 1 month ago

I just fiddled with this issue a little bit myself and I found a possible solution for anybody who is actually annoyed by this. It requires a bit of tinkering though...

Solution

Edit your firefox.desktop file and change all the Exec statements to point at the firefox-bin instead of firefox. The firefox-bin is usually not available in $PATH so you'll either have to add it to $PATH (e.g. by creating a symlink in /usr/bin that points to the actual firefox-bin location) or you can just specify the full path in the Exec properties in your firefox.desktop file and not worry about any availability in $PATH, as it is quite unnecessary.

You might need to delete the "weird" desktop file that Firefox created at some point in ~/.local/share/applications/ in order to clean up.

You might also want to clean up any leftover mess in the ~/.config/mimeapps.list, since the "Default Applications" GUI only shows very limited options compared to the configuration file.

Approach / Insights

With xdg-settings get default-web-browser you can see which *.desktop file is referenced by the selection in the Settings > Default Applications GUI section.

$ xdg-settings get default-web-browser 
userapp-Firefox-ARULS2.desktop

I thought the only reason why Firefox gives the "Want to make Firefox your Default Browser?" prompt was that the firefox binary seems to be just a tiny wrapper for the firefox-bin which is located in the same place.

The additional *.desktop file that gets created when confirming the dialog in Firefox is located with a "weird" name in ~/.local/share/applications/userapp-Firefox-ARULS2.desktop in my case. Looking into it, it does in fact reference the other executable Exec=/usr/lib/firefox/firefox-bin %u. This desktop file also has NoDisplay=true, which leads to it being hidden in the GNOME applications list and since it doesn't have an Icon property either, it will display with the cogwheel fallback icon.

So I thought it might just be possible to "avoid" the plain firefox binary in the normal firefox.desktop file and reference the firefox-bin directly in all the Exec properties... So I changed all 4 Exec properties (for Desktop Actions as well) that were in my firefox.desktop file to the full path to the firefox-bin and I renamed the userapp-Firefox-ARULS2.desktop to userapp-Firefox-ARULS2.desktop.bak in order to "disable" it. Upon starting firefox, you may get the default browser prompt again, but when you confirm it, the system should be able to just use your normal firefox.desktop file and you should be able to get rid of the "weird" one.

You might also want to clean up any leftover mess in the ~/.config/mimeapps.list, since the "Default Applications" GUI only shows very limited options compared to the configuration file.

Alternative partial fix

You could also do the following to make it a little bit more "pretty" without manipulating your normal firefox.desktop file:

Maybe with this additional information someone else might be able to find a better solution at some point.

rhanneken commented 1 month ago

My workaround was to create ~/.xsessionrc and add this line to it:

export MOZ_APP_LAUNCHER=/usr/bin/firefox

It doesn't help when you're opening links in Thunderbird (if I recall correctly, because it sets its own value for MOZ_APP_LAUNCHER), but otherwise it does.