Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal Desktop does not open links in the default browser #6551

Closed
2 tasks done
TheKingOfLight opened this issue Jul 30, 2023 · 25 comments
Closed
2 tasks done

Signal Desktop does not open links in the default browser #6551

TheKingOfLight opened this issue Jul 30, 2023 · 25 comments
Labels

Comments

@TheKingOfLight
Copy link

  • I have searched open and closed issues for duplicates
  • I am using Signal-Desktop as provided by the Signal team, not a 3rd-party package.

Bug Description

When I click on a link in the Signal desktop app, the website opens in Microsoft Edge instead of the default Firefox browser. All other apps always open links in Firefox.

Steps to Reproduce

  1. Install Microsoft Edge (flathub)
  2. Set Firefox as the default browser
  3. Click on a link in Signal Desktop

Actual Result:

  1. Launch Micosoft Edge
  2. Open the link in Micosoft Edge

Expected Result:

Opens Firefox (default browser) with the link (Like all other applications)

Platform Info

Signal Version: 6.26.0 (apt-repository)

Operating System: Linux Mint 21.2, Kernel 6.2.0

Link to Debug Log

https://debuglogs.org/desktop/6.26.0/0cc37b33904ccdd53b9e9c8a4a53d4e0ef1b90dd230508b60418000e8794971b.gz

@TheKingOfLight TheKingOfLight changed the title Signal Desktop does not open links in the default browser Browser Signal Desktop does not open links in the default browser Jul 30, 2023
@jamiebuilds-signal
Copy link
Member

Question: Do you have any other Electron-based apps installed on your device, or could you install one of them? That way we can see if this is an Electron based issue or not

@hacker-szabo
Copy link

Hi, I am running Signal Desktop on Linux Mint as well (from snap)

The links open in Firefox. VSCode which uses electron as well I believe opened links in Firefox as well.

But here is an important information: The issue might be with xfce because I changed my desktop environment to KDE a week ago and these changed:

  • Signal links opened in Firefox as before
  • Any other electron app opened links in VSCode (as a HTML source... weird) - I made an electron app, I tested links in VSCode and in Obsidian
  • Changing the default applications in the KDE GUI settings solved the problems and now everything is opening in Chromium. This setting did not work in xfce as I recall.

The KDE settings that worked (as a workaround until it works):

  • search for "Default Applications"
  • Go to "Web Browser" in the left menu
  • Select the second option and select your browser in the drop down menu.

@scottnonnenberg-signal
Copy link
Contributor

@TheKingOfLight Is this also your situation? Does this workaround fix things for you?

@fallenguru
Copy link

Ubuntu 22.04, default browser set to firefox-esr in the GNOME settings as well as via update-alternatives. Signal still opens Chrome.

@scottnonnenberg-signal
Copy link
Contributor

What does xdg-open do? I think that's what Electron is trying to use.

@fallenguru
Copy link

What does xdg-open do?

Here at least it opens Firefox ESR, as intended.

@scottnonnenberg-signal
Copy link
Contributor

Does anything change if you restart desktop? It's possible that it's caching?

@paullak12
Copy link

I have the same problem. Ubuntu 23.04, KDE. Signal is opening Chrome and my default browser is Vivaldi. Chrome was my default browser two months ago.

@trevor-signal
Copy link
Contributor

trevor-signal commented Sep 1, 2023

Electron is just using xdg-open under the hood, as Scott mentioned, so I'm surprised there is a difference. See Electron's code here:

https://github.com/electron/electron/blob/89659fa9c997977ee2a25ce2c769d86742eccb90/shell/common/platform_util_linux.cc#L302

@paullak12 can you try /usr/bin/xdg-open https://signal.org?

@fallenguru
Copy link

fallenguru commented Sep 1, 2023

Obsolete, except for the solution itself, see below.


I found what was behind the problem in my case, obviously we may be dealing with multiple issues here.

Anyway, as I said, update-alternatives --all was set to firefox-esr where possible, the default web browser according to the GNOME control center (which should be the XDG default browser) showed the Firefox icon and said "Firefox", too, and all other software launched Firefox [ESR], so I assumed all was as well.

Problem is, GNOME just shows an icon and a "friendly" name. xdg-settings get default-web-browser had "firefox.desktop". Looks fine at first glance, but it turns out I'm not using firefox, it's not even installed, I'm using firefox-esr--entirely different programme, same icon, same "friendly" name ...

Long story short, changing the default browser to Chrome in the GNOME settings and then changing it back did the trick. Now xdg-settings says "firefox-esr.desktop", too.

IOW the configured default browser was missing, and so one of the existing candidates got selected. Why Signal would consistently pick Chrome while everything else fell back to Firefox ESR I couldn't say. But then Signal is my only Electron app, so it may just be a case of Electron preferring Chrome.

@paullak12
Copy link

It seems that the problem in my case was the system settings. I theoretically had the vivaldi browser set as the default, but the settings kept setting chrome for some reason. In this situation, every Elektron application was using chrome by default. I finally managed to set vivaldi permanently and all electrons started using vivaldi. It looks more like a system problem than a signal app problem. Thanks!

@fallenguru
Copy link

fallenguru commented Sep 5, 2023

It just bit me on another box, one that definitely had default-web-browser set correctly. Still required me to change the GNOME control center default to another browser and back before it would stick. So my hypothesis as to the cause of this seems to be incorrect, though the solution is still good.

Does Signal/Electron somehow cache the XDG settings at install time, then only update them when they're explicitly changed?

@trevor-signal
Copy link
Contributor

Does Signal/Electron somehow cache the XDG settings at install time, then only update them when they're explicitly changed?

Not that I'm aware of. Closing this issue for now as it seems to be a systems settings issue.

@gantryyork
Copy link

Same thing happens in with Ubuntu (Linux). My default browser is Brave, but everytime I click on a URL in Signal Desktop, it opens in Firefox.

Hard to believe this was reported over a year ago and it's not fixed. I'll donate if you fix it.

@scottnonnenberg-signal
Copy link
Contributor

@gantryyork When was the last time you changed your default browser? Does Desktop pick up the right browser if you close it and open it back up? Or if you reboot?

@davidmegginson
Copy link

This is still an issue for me. Clicking a link in Signal opened Calibre; after uninstalling Calibre, Signal tried to open LibreOffice. xdg-open with a URL starts Firefox, as expected.

I don't think you can punt this as a "systems setting issue" if it doesn't work by default for many (most?) Linux users.

@maba4891
Copy link

maba4891 commented Sep 26, 2024

Had the same issue after reinstalling a fresh Ubuntu Linux (links in Signal Desktop opened in Chromium instead of Firefox, which is my default browser in the settings).

As recommended by @fallenguru I ran update-alternatives --all and the changed the default browser to Chromium in the GNOME settings and then changed it back to Firefox.

Now links open in Firefox (which is what I want)

@davidmegginson
Copy link

Still not working. I installed chromium and then used update-alternatives to change x-www-browser and gnome-www-browser from firefox to chromium and then back again. Also confirmed in gnome-settings that my default browser is firefox.

When chromium is installed, signal-desktop tries to open links in it, even when I've chosen firefox as my default. When chromium is uninstalled, signal-desktop tries to open links in LibreOffice, even though firefox is installed and correctly configured as the default browser.

@trevor-signal -- this is definitely not a settings issue, but a bug in the software. Please reopen the issue until it's resolved. Thanks!

(Ubuntu 24.04, signal-desktop 7.25.0)

@davidmegginson
Copy link

I did manage to make it work in the end with

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

That's an awful technical deep dive for most users, so I'll maintain that this needs to be fixed in Signal so that the out-of-the-box behaviour is the correct one.

Still

@fallenguru
Copy link

Still not working. I [...] used update-alternatives to change x-www-browser and gnome-www-browser from firefox to chromium and then back again. Also confirmed in gnome-settings that my default browser is firefox.

That won't work, though. update-alternatives isn't the issue. I mean, if you want Firefox as your default browser, you probably want it set as default browser there, too, but that's nothing to do with Signal. It's also not buggy—if update-alternatives says Firefox is set as default, then it is.

You need to change the XDG default browser to something else and back again. Whether you do it using GNOME Settings or xdg-settings is immaterial. Even if GNOME Settings / xdg-settings already shows Firefox as default browser, even if other software already respects the setting. Change it to something else, and then back.

@davidmegginson
Copy link

It will seem bizarre to a new user without Chrome or Chromium installed, signal-desktop tries to open LibreOffice instead of Firefox as the web browser in a default Ubuntu installation. How hard is that to fix to improve the Signal U/X?

@fallenguru
Copy link

How hard is that to fix to improve the Signal U/X?

Possibly quite hard, if the underlying issue is in Electron and/or Ubuntu, which is likely.

FWIW, I do agree that this bug should be reopened, because it manifests in Signal.

@Penguin-Guru
Copy link

Penguin-Guru commented Oct 18, 2024

I am having a similar problem. xdg-open (and all other non-Electron apps I've tried) are able to open links in an existing Firefox session. When I try to open the same links in Signal (or the one other Electron app I have installed), there is a few seconds delay and then a popup appears saying "can't open firefox. already running". This has been the behaviour since I set Firefox as my default browser. Chromium worked fine.

xdg-settings shows default-web-browser and default-url-scheme-handler for both http and https as "firefox-bin.desktop", which is what I believe it should be on my system and which seems to work for all other applications.

In case this helps: https://support.mozilla.org/en-US/kb/firefox-already-running-not-responding

@thehowl
Copy link

thehowl commented Oct 22, 2024

I don't know what's going here, but if somebody stumbles upon it I followed the paper trail from this reddit thread into this github issue and fixed it by executing the following (ubuntu 24.04):

gio mime  x-scheme-handler/http firefox_firefox.desktop
gio mime  x-scheme-handler/https firefox_firefox.desktop

This worked, even though gio mime x-scheme-handler/https was already saying firefox was the preferred application. No idea what's actually going on here.

@davidmegginson
Copy link

davidmegginson commented Oct 24, 2024

So this might be an upstream Electron bug rather than a Signal Desktop bug, but in either case, it's not a problem with user configuration, so from a user's PoV, it's still a Signal bug. The user can have configured their system 100% correctly, and this bug will still occur unless they do workaround hacks.

Please reopen until it's genuinely resolved. If it's blocked waiting for an upstream Electron bugfix, then one can set the issue's status to show that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests