desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Zen Browser don't detect that it's already default and keeps giving the window asking for to become the default browser.

Open goliv04053 opened this issue 1 year ago • 29 comments

Captchas

  • [X] I have read the instructions.
  • [X] I have searched existing issues and avoided creating duplicates.
  • [X] I am not filing an enhancement request.

What happened?

When I open Zen Browser it gives me the window saying that it's not the default browser. But it's already the default browser

Reproducible?

  • [x] I have checked that this issue cannot be reproduced on Mozilla Firefox.

Version

1.0.2-b.5 (Firefox 133.0.3)

What platform are you seeing the problem on?

Linux

Relevant log output

No response

goliv04053 avatar Dec 26 '24 16:12 goliv04053

This actually happened to me twice on Fedora 41.

Launched app > asked to set default browser (Yes) > Closed and repeat after those two tries it didn't show again. Can you report if it still happens to you?

Edit: Doing some search i found that it first launched zen then zen-bin that's why it asked for it twice.

syscat29 avatar Dec 28 '24 01:12 syscat29

@j14i It still happens to me and i'm also using Fedora 41

goliv04053 avatar Dec 28 '24 07:12 goliv04053

I had it happen to me on pop!_os as well, went away by itself, not sure if I did something or zen got updated. I installed zen from flathub

gg-plato avatar Dec 30 '24 04:12 gg-plato

This keeps happening to me on two Regolith Desktop (Ubuntu base) laptops.

siraht avatar Dec 30 '24 18:12 siraht

Tried again and it keeps happening to me too now. I'll move this to the To Do list then.

Thank you guys and do not close the issue btw, well handle that once it's fixed.

syscat29 avatar Dec 30 '24 18:12 syscat29

Same issue both on ubuntu and fedora (appImage)

gautierlabarre avatar Jan 03 '25 22:01 gautierlabarre

I have the same issue on Fedora 41(flathub). There is an another problem when I try to setup PWA extension. The extension needs additional program. I installed the program but the extension doesn't recognize the program. When I try to install on the normal firefox, it installed with no problem. Screenshot 2025-01-04 at 13-34-59 Ekran Görüntüsü 2025-01-04 13-05-03 png (PNG Image 1920 × 1080 pixels) — Scaled (92%)

CatalyzoRR avatar Jan 04 '25 10:01 CatalyzoRR

Alright, seems that on linux upon first launch clicking "Set as default browser" does not tell the browser it's been set as default and as such keeps asking to be set as default on subsequent launches, checking "Do not ask again" before setting as default does the job.

syscat29 avatar Jan 04 '25 17:01 syscat29

Update: This may be a flatpak related issue since flatpak apps are sandboxed, this does not happen when the browser is directly installed into the system (e.g AUR or tarball) for now just click Do not ask again.

syscat29 avatar Jan 04 '25 17:01 syscat29

it's not a flatpak related issue as I have the same issue with appimage.

gautierlabarre avatar Jan 05 '25 09:01 gautierlabarre

Please try using the tarball and report back if the issue persists

syscat29 avatar Jan 06 '25 02:01 syscat29

it's not a flatpak related issue as I have the same issue with appimage.

I think what @j14i meant is that installing outside of sandbox environments (appimage, flatpak, snaps) would not experience this issue. If sandboxing is the case, is it a xdg-portals issue?

imdaveho avatar Jan 17 '25 23:01 imdaveho

I'm using the 1.7.2b tarball version, and the issue still occurs on Ubuntu 24.04. When I set Zen as the default browser, a .desktop file is created in /home/<username>/.local/share/applications/.

The new .desktop duplicates zen as option for default browser in Configuration app.

Image

The Zen Browser option is from .desktop I created in /usr/share/applications when I installed Zen. The Zen options is from .desktop created in /home/<username>/.local/share/applications/. When this is selected Zen stops asking for default browser.

eduardoleolim avatar Jan 28 '25 02:01 eduardoleolim

I found the function that creates the .desktop file. It is SetDefaultBrowser in browser/components/shell/nsGNOMEShellService.cpp.

The function uses the Gio Library to find the application executable (.desktop file), if the application executable isn't found another one is created. Then the new executable is set as default browser.

This is the console's output when I open Zen and I set it as default browser:

lib warning', file /home/ubuntu/actions-runner/_work/desktop/desktop/engine/toolkit/xre/nsSigHandlers.cpp:201

(zen:44693): GLib-CRITICAL **: 12:59:48.798: g_find_program_for_path: assertion 'program != NULL' failed

I think this happens with any Linux distro that uses GNOME.

eduardoleolim avatar Feb 02 '25 21:02 eduardoleolim

Slightly unrelated but trying to find a pattern here which could be a related issue.

The guys on Fedora 41, does it also not re-open the tabs for you guys after your close and re-open your window along with asking to make it as default browser? I just got off from the subreddit where people are saying that re-opening the browser works fine for them. That is, the tabs open up fine after they close and open the browser.

Does this work fine for you as well? For me I am always greeted with the default browser pop-up and am lead to the empty first tab though the workspaces are retained without an issue.

joseph9991 avatar Feb 05 '25 16:02 joseph9991

Same issue here with the appimage release on Ubuntu 24.04

CreateWebNZ avatar Feb 09 '25 18:02 CreateWebNZ

Slightly unrelated but trying to find a pattern here which could be a related issue.

The guys on Fedora 41, does it also not re-open the tabs for you guys after your close and re-open your window along with asking to make it as default browser? I just got off from the subreddit where people are saying that re-opening the browser works fine for them. That is, the tabs open up fine after they close and open the browser.

Does this work fine for you as well? For me I am always greeted with the default browser pop-up and am lead to the empty first tab though the workspaces are retained without an issue.

Ok so I found out the issue. It could be either of the below 2 points or both of them:

  1. General Settings -> Check Reopen windows and tabs
  2. History -> Uncheck the "Clear history when Zen closes"

Reference: https://github.com/zen-browser/desktop/issues/2601

joseph9991 avatar Feb 09 '25 18:02 joseph9991

Same issue here with the appimage release on Ubuntu 24.04

For the default, what worked for me in Fedora was to go to System settings and navigate Defaults. Then check the default browser list. Check if there are 2 zen browsers i.e. "Zen" and "Zen Browser". Select the latter. If still the default shows up then click on Not now.

This is what I read on Reddit.

joseph9991 avatar Feb 09 '25 18:02 joseph9991

I think I found a solution if GNOME is used as desktop environment.

It's necessary set the environment variable MOZ_APP_LAUNCHER with "zen" value. This environment variable is used to define the variable mAppPath in nsGNOMEShellService.cpp.

The variable mAppPath is used in the function setDefaultBrowser to find the .desktop file. If MOZ_APP_LAUNCHER is not defined then the .desktop file will never be found.

A solution is set MOZ_APP_LAUNCHER before launch Zen.

MOZ_APP_LAUNCHER="zen" zen

Now when Zen is set as default browser another .desktop file is not created.

I set Zen as default browser before record this video

https://github.com/user-attachments/assets/a69ce7f2-0483-4eed-beb7-2ccbd0707064

I deleted a symlink that I created in the /usr/bin directory, then I created a script in /usr/bin to set de environment variable:

sudo nano /usr/bin/zen
#!/bin/sh
export MOZ_APP_LAUNCHER=zen
exec /opt/zen/zen "$@"

Then I executed these commands:

sudo chmod 755 /usr/bin/zen 

sudo chown root:root /usr/bin/zen

eduardoleolim avatar Feb 10 '25 03:02 eduardoleolim

Another solution could be found here. That code is executed when MOZ_APP_LAUNCHER is not set.

I would debug the code to find the error, but my pc crashes when I try to compile the source code.

eduardoleolim avatar Feb 11 '25 05:02 eduardoleolim