Electron apps <URL> handling


I am asking for help. It’s bugging me for a long time.

When I click a link inside an Electron app like “signal-desktop” it gets openned in my browser of choice “qutebrowser” 3x times.

I thought that there is a problem with $BROWSER variable, so when I reexport it as

export BROWSER="firefox" && signal-desktop

Then clicking a link will open the URL 1x in qutebrowser and 1x in firefox.

I can’t find any lead for what is causing this.

This is most likely an application issue.

My favorite illustration is the application bug - where the cause of the bug is the user double clicking a button - causing some actions to fail - until the developer disables button interaction on the first click.

As electron apps - in reality is a browser application - the developer of the application in question may have the same problem - or something like it.

So the first place to look is the source code - if you don’t know how/what/where - ask the developer.

OK I’ll dig, but it so common in many Electron apps like VScode and Signal, that I figured might be common issue for many.

That sounds weird - please - if possible - provide a concrete reproducible example.


No graphical login manager, login to zsh from the agetty on /dev/tty1.
From zsh the wlroots Sway window manager is started.

Profile environment is generated with systemd
~freed00m/dotfiles: .config/environment.d/ - sourcehut git

Clicking on urls on any Electron app will open 3x in qutebrowser, the second and third link is openned after delay so I suspect it calls arbitrary app like xdg-open.

OK, my bad.

Electron apps will ignore $BROWSER if xdg-open exists.

I had qutebrowser wrapper and mistakenly called disown in a POSIX shell “/bin/dash”

Dash don’t know disown and returned non-zero exit code.
xdg-open retries it twice, ergo it succeded everytime.

For the BROWSER=“firefox” it will first try xdg-open, and if fails xdg-open will use $BROWSER.

Damn that’s complex

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.