You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Wrong web browser opened when clicking links #42611
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
30.0.6
What operating system are you using?
Ubuntu
Operating System Version
Ubuntu 24.04
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
The shell.openExternal call appears to open links in Google Chrome even if Firefox is configured as the default browser.
This happens when using the Ferdium and Slack apps, making me think it's an ElectronJS issue. No non-ElectronJS applications on by Ubuntu install have this problem.
Actual Behavior
If Firefox is the default browser, e.g. as shown with Ubuntu's update-alternatives --get-selections command, links should open in Firefox.
Testcase Gist URL
No response
Additional Information
This has been confirmed on two installations of Ubuntu 24.04, so it could be a weird configuration in 24.04 that's not being updated properly, and that only ElectronJS appears to take note of. I don't think it happened with Ubuntu 20.04.
The only workaround I've found so far is to make Chrome fail so it falls back to Firefox, e.g. by renaming /usr/bin/google-chrome-stable to something else.
Unfortunately, I don't have the skills to build a Fiddle, but I am willing to test it. My initial investigation though suggested Fiddle only has a Chrome stub, this might not be testable.
Reacted by Jan Sandbrink, Victorien, Kolja Sam and Mikita Hradovich
Hello @bittylicious. Thanks for reporting this and helping to make Electron better!
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
Now adding the
blocked/need-reproNeeds a test case to reproduce the bug
label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
As said in the issue, I think the Fiddle won't be helpful here because it has some sort of Chrome stub, so I don't think it'll try and use what it thinks is the default web browser. I'm not 100% sure of this though, but based on this being a possibility, I think it can only be tested with a real app.
In reality, this should be reproducible using any normal Electron app, as long as you perform the following steps:
Install Ubuntu 24.04.
Install Firefox and make it the default browser.
Run any Electron app that opens external links, e.g. Slack or Ferdium, and see it open in Chrome.
If someone could just perform the above steps to confirm this is an issue, it would be appreciated.
I personally have done the above on two clean machines, and the issue is visible.
It of course could be an issue with Ubuntu, but I'm not sure how the underlying choice is made by Electron as to what browser to open.
@bittylicious Rather than just run any Electron app, it is helpful to have a test case with only the components necessary to reproduce the issue. It is very difficult and time consuming to triage an issue with many third-party dependencies, so that is why we ask for such a test case. It also ensures that everyone attempting to fix the issue is looking at the problem in the same way. If you are unable to make a Fiddle gist that accomplishes this, you can also try cloning https://github.com/electron/electron-quick-start and including the components necessary in that cloned repository.
I am adding
blocked/need-info ❌Cannot proceed without more information
for this reason. Once you are able to make a test case, please link it in a follow up comment. This issue will be closed in 10 days if the above is not addressed.
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.
@bittylicious I feel your pain on this, just wanted to let you know that I face the same issue.
Not that anyone from Electron will be reading this anymore, but the bug reporting process is broken IMHO. You explained pretty clearly that you are a user/consumer of electron apps and thus unable to provide code, but you included great reproduction instructions.
However, people and bots involved were apparently not able to deal with reports from non-devs. Here's hoping that some day someone with Electron skills (I have none) will face this issue and report it.
I can also reproduce on Ubuntu 24.04, and I believe it wasn't the case on 22.04. I have both Firefox and Chrome installed on my machine. I can reproduce on Slack and VSCode, although Discord works as expected.
While the Linux implementation of openExternal seems to rely on xdg-open:
Firefox is configured as being my default browser:
$ xdg-settings get default-web-browser
firefox_firefox.desktop
Note that upon calling shell.openExternal, I get the following error logged:
[2066424:2066424:1220/223619.954207:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.NotSupported: This method is not part of the idle inhibition specification: https://specifications.freedesktop.org/idle-inhibit-spec/latest/
Created TensorFlow Lite XNNPACK delegate for CPU.
Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors (tensor#-1 is a dynamic-sized tensor).
As a workaround, adding the following in ~/.local/share/applications/mimeapps.list:
resolves the issue, and I don't get the logged error anymore.
Reacted by Michaela Laurencin, Alexey Murz Korepov, Mohamed Abdultawab, noancloarec, Kolja Sam, David Benque, Jose, lensysLabs, Gareth Evans, Morgan Rowse and 6 more
Reacted by valumar and Alexis D
Reacted by mkreidenweis-schulmngr, Gareth Evans, Morgan Rowse, githubnemo, valumar, Gemma van der Voort and Alexis D
@Viicos Thank you for that reproduction. The example functioned as expected on Windows, so that Linux implementation is most likely the cause of the problem. As this has been closed and a new issue was created above, I will go ahead and provide similar information there. Any further information or conversation related to this issue should take place there as well.
I know this issue is closed, but adding a confirmed workaround / datapoint in case it helps others.
On Ubuntu 24.04 GNOME, Electron apps (tested with Discord) opened links in Chrome even though Firefox was the default browser and xdg-mime handlers were correct.
Launching the app with:
XDG_CURRENT_DESKTOP=GNOME
causes links to open in Firefox as expected. (the originally set XDG_CURRENT_DESKTOP was set as Ubuntu:GNOME.) This suggests Electron may be mis-detecting or misusing the desktop environment, similar to the workaround used by Tutanota: tutao/tutanota@439260e
Activity
electron-issue-triage commentedon Jun 26, 2024
Hello @bittylicious. Thanks for reporting this and helping to make Electron better!
Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
Now adding the blocked/need-reproNeeds a test case to reproduce the bug
label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
bittylicious commentedon Jun 27, 2024
Hello bot.
As said in the issue, I think the Fiddle won't be helpful here because it has some sort of Chrome stub, so I don't think it'll try and use what it thinks is the default web browser. I'm not 100% sure of this though, but based on this being a possibility, I think it can only be tested with a real app.
In reality, this should be reproducible using any normal Electron app, as long as you perform the following steps:
If someone could just perform the above steps to confirm this is an issue, it would be appreciated.
I personally have done the above on two clean machines, and the issue is visible.
It of course could be an issue with Ubuntu, but I'm not sure how the underlying choice is made by Electron as to what browser to open.
mlaurencin commentedon Jun 27, 2024
@bittylicious Rather than just run any Electron app, it is helpful to have a test case with only the components necessary to reproduce the issue. It is very difficult and time consuming to triage an issue with many third-party dependencies, so that is why we ask for such a test case. It also ensures that everyone attempting to fix the issue is looking at the problem in the same way. If you are unable to make a Fiddle gist that accomplishes this, you can also try cloning https://github.com/electron/electron-quick-start and including the components necessary in that cloned repository.
I am adding blocked/need-info ❌Cannot proceed without more information
for this reason. Once you are able to make a test case, please link it in a follow up comment. This issue will be closed in 10 days if the above is not addressed.
electron-issue-triage commentedon Sep 26, 2024
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
electron-issue-triage commentedon Oct 27, 2024
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.
NobodysNightmare commentedon Dec 10, 2024
@bittylicious I feel your pain on this, just wanted to let you know that I face the same issue.
Not that anyone from Electron will be reading this anymore, but the bug reporting process is broken IMHO. You explained pretty clearly that you are a user/consumer of electron apps and thus unable to provide code, but you included great reproduction instructions.
However, people and bots involved were apparently not able to deal with reports from non-devs. Here's hoping that some day someone with Electron skills (I have none) will face this issue and report it.
bittylicious commentedon Dec 10, 2024
@NobodysNightmare Thanks so much - you absolutely echo what I feel!
This is really easy to repeat and has been going on since 24.04's release. It's surprising a dev doesn't want to reproduce this themselves.
Viicos commentedon Dec 20, 2024
@mlaurencin, here is a Fiddle repro: https://gist.github.com/Viicos/d77af018be1b7b27294a74c378731992.
I can also reproduce on Ubuntu 24.04, and I believe it wasn't the case on 22.04. I have both Firefox and Chrome installed on my machine. I can reproduce on Slack and VSCode, although Discord works as expected.
While the Linux implementation of
openExternalseems to rely on xdg-open:electron/shell/common/platform_util_linux.cc
Lines 352 to 361 in 2745771
Firefox is configured as being my default browser:
Note that upon calling
shell.openExternal, I get the following error logged:[2066424:2066424:1220/223619.954207:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.NotSupported: This method is not part of the idle inhibition specification: https://specifications.freedesktop.org/idle-inhibit-spec/latest/ Created TensorFlow Lite XNNPACK delegate for CPU. Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors (tensor#-1 is a dynamic-sized tensor).As a workaround, adding the following in
~/.local/share/applications/mimeapps.list:resolves the issue, and I don't get the logged error anymore.
NobodysNightmare commentedon Jan 6, 2025
FYI: I opened a new issue #45129 as per the bot's suggestion, assuming that no one from Electron would ever look at this closed issue anymore.
mlaurencin commentedon Jan 6, 2025
@Viicos Thank you for that reproduction. The example functioned as expected on Windows, so that Linux implementation is most likely the cause of the problem. As this has been closed and a new issue was created above, I will go ahead and provide similar information there. Any further information or conversation related to this issue should take place there as well.
amaranth133 commentedon Jan 18, 2026
I know this issue is closed, but adding a confirmed workaround / datapoint in case it helps others.
On Ubuntu 24.04 GNOME, Electron apps (tested with Discord) opened links in Chrome even though Firefox was the default browser and xdg-mime handlers were correct.
Launching the app with:
XDG_CURRENT_DESKTOP=GNOME
causes links to open in Firefox as expected. (the originally set XDG_CURRENT_DESKTOP was set as Ubuntu:GNOME.) This suggests Electron may be mis-detecting or misusing the desktop environment, similar to the workaround used by Tutanota:
tutao/tutanota@439260e