10
9
Fork
You've already forked linux-app
14

Does not honor Librewolf as default browser, starts Firefox instead #692

Closed
opened 2026年04月08日 23:55:48 +02:00 by krakel · 12 comments

Installation

AUR via yay

Version

eduvpn_client 4.7.1
eduvpn_common 5.0.1

OS/Distribution

Arch, KDE Plasma 6.6.4, wayland, systemd,

I have Librewolf and Firefox installed, with Librewolf as default browser and where I'm logged in to my institution. Yet it opens in Firefox each time, have used eduvpn for about three months. I have never had issues with the wrong browser opening when clicking an URL in other apps. I read here that it's supposed to check the default browser but for some reason this doesn't happen here. My spontaneous guess is that the paths somehow are too similar for eduvpn so the wrong app opens. Let me know if you need any logs or anything like that.

Thank you for your hard work!

# Installation AUR via yay # Version eduvpn_client 4.7.1 eduvpn_common 5.0.1 # OS/Distribution Arch, KDE Plasma 6.6.4, wayland, systemd, I have Librewolf and Firefox installed, with Librewolf as default browser and where I'm logged in to my institution. Yet it opens in Firefox each time, have used eduvpn for about three months. I have never had issues with the wrong browser opening when clicking an URL in other apps. I read here that it's supposed to check the default browser but for some reason this doesn't happen here. My spontaneous guess is that the paths somehow are too similar for eduvpn so the wrong app opens. Let me know if you need any logs or anything like that. Thank you for your hard work!

What happens when run this command from the terminal?

xdg-open https://www.example.org

Does it open LibreWolf, or Firefox?

What it the output of xdg-settings get default-web-browser?

What happens when run this command from the terminal? ``` xdg-open https://www.example.org ``` Does it open LibreWolf, or Firefox? What it the output of `xdg-settings get default-web-browser`?
Author
Copy link

Hi,

Running the command opens in Librewolf, the output of the command is librewolf.desktop.

Thank you for replying!

Hi, Running the command opens in Librewolf, the output of the command is librewolf.desktop. Thank you for replying!

can you try: python -c "import webbrowser; webbrowser.open('https://example.org')"

can you try: `python -c "import webbrowser; webbrowser.open('https://example.org')"`
Author
Copy link

Ah, there's the culprit! It opens in Firefox. Thank you! How can I resolve this?

Ah, there's the culprit! It opens in Firefox. Thank you! How can I resolve this?

can you post the output of:

echo $BROWSER

?

can you post the output of: `echo $BROWSER` ?
Author
Copy link

It's blank, very blank!

It's blank, very blank!

Did you ever manage to solve this? Did you try with a clean system?

Did you ever manage to solve this? Did you try with a clean system?
Author
Copy link

Yes, actually today I discovered that I have a system variable called BROWSER which was set to firefox, and this override the default-web-browser. No idea how it ended up being registered, but I changed it to librewolf and now it's working. Thank you for your help!

Yes, actually today I discovered that I have a system variable called BROWSER which was set to firefox, and this override the default-web-browser. No idea how it ended up being registered, but I changed it to librewolf and now it's working. Thank you for your help!
Author
Copy link

Wait, I spoke too soon, python -c "import webbrowser; webbrowser.open('https://example.org')" opens in librewolf, but eduvpn still opens it in firefox!
Is eduVPN running in a virtual environment with its own variables somehow?

Wait, I spoke too soon, `python -c "import webbrowser; webbrowser.open('https://example.org')"` opens in librewolf, but eduvpn still opens it in firefox! Is eduVPN running in a virtual environment with its own variables somehow?
Author
Copy link

So...

This is kind of weird. I tried adding a specific call for librewolf in the code, though this didn't work, just gave an error that it couldn't find the browser.

@run_in_background_thread("open-browser")
 def open_browser(self, url):
 logger.debug(f"Opening web browser with url: {url}")
 _webbrowser.get(using='librewolf')_
 webbrowser.open(url)
 # Explicitly wait to not have zombie processes
 # See https://bugs.python.org/issue5993
 logger.debug("Running os.wait for browser")

Then I added librewolf as a mozilla class browser in /usr/lib/python3.14/webbrowser.py, but that just opened it in firefox instead. Similar issues has been reported a few places, but it's kind of weird.

I ended up doing a silly workaround which runs webbrowser.open_new(url) instead, and in webbrowser.py I changed that command to open a private firefox window lol. It will work until something updates.

So... This is kind of weird. I tried adding a specific call for librewolf in the code, though this didn't work, just gave an error that it couldn't find the browser. ``` @run_in_background_thread("open-browser") def open_browser(self, url): logger.debug(f"Opening web browser with url: {url}") _webbrowser.get(using='librewolf')_ webbrowser.open(url) # Explicitly wait to not have zombie processes # See https://bugs.python.org/issue5993 logger.debug("Running os.wait for browser") ``` Then I added librewolf as a mozilla class browser in /usr/lib/python3.14/webbrowser.py, but that just opened it in firefox instead. Similar issues has been reported a few places, but it's kind of weird. I ended up doing a silly workaround which runs webbrowser.open_new(url) instead, and in webbrowser.py I changed that command to open a private firefox window lol. It will work until something updates.

@krakel wrote in #692 (comment):

Wait, I spoke too soon, python -c "import webbrowser; webbrowser.open('https://example.org')" opens in librewolf, but eduvpn still opens it in firefox! Is eduVPN running in a virtual environment with its own variables somehow?

Mainly for the sake of completeness:

How did you test it? How you did you set it?
export BROWSER=librewolf

When you set BROWSER=librewolf in a single bash window, that variable only exists in that shell process and its child processes. It doesn't propagate to other terminal windows, GUI or system-wide applications.

grep -r "BROWSER" ~/.bashrc ~/.bash_profile ~/.profile /etc/bash.bashrc /etc/profile /etc/profile.d/ 2>/dev/null
systemctl --user show-environment | grep BROWSER
~/.config/environment.d/ or ~/.config/plasmarc ?

etc.

If systemd, it might help to:

mkdir -p ~/.config/environment.d/
echo 'BROWSER=librewolf' > ~/.config/environment.d/90-prio_browser.conf

(and reboot for sure)

(削除) However, it is better to find out why this variable has a value on this system. (削除ここまで)
Oh, my fault, sorry... you've said was empty before. That's also true for my system (openSUSE 16.0 Gnome 48) which seems right to me...

PS: Hard-coding sounds very weird as solution...

@krakel wrote in https://codeberg.org/eduVPN/linux-app/issues/692#issuecomment-14696598: > Wait, I spoke too soon, `python -c "import webbrowser; webbrowser.open('https://example.org')"` opens in librewolf, but eduvpn still opens it in firefox! Is eduVPN running in a virtual environment with its own variables somehow? Mainly for the sake of completeness: How did you test it? How you did you set it? `export BROWSER=librewolf` When you set BROWSER=librewolf in a single bash window, that variable only exists in that shell process and its child processes. It doesn't propagate to other terminal windows, GUI or system-wide applications. ``` grep -r "BROWSER" ~/.bashrc ~/.bash_profile ~/.profile /etc/bash.bashrc /etc/profile /etc/profile.d/ 2>/dev/null systemctl --user show-environment | grep BROWSER ~/.config/environment.d/ or ~/.config/plasmarc ? ``` etc. If systemd, it might help to: ``` mkdir -p ~/.config/environment.d/ echo 'BROWSER=librewolf' > ~/.config/environment.d/90-prio_browser.conf ``` (and reboot for sure) ~~However, it is better to find out why this variable has a value on this system.~~ Oh, my fault, sorry... you've said was empty before. That's also true for my system (openSUSE 16.0 Gnome 48) which seems right to me... PS: Hard-coding sounds very weird as solution...
Author
Copy link

I had no idea that environment variables were local to the shell process, sorry about that. I found the offending variable in /etc/environment and changed it. Awesome, thank you for the help!

TLDR; the offender in this case is Python who puts the BROWSER variable before xdg-settings.

I had no idea that environment variables were local to the shell process, sorry about that. I found the offending variable in /etc/environment and changed it. Awesome, thank you for the help! TLDR; the offender in this case is Python who puts the BROWSER variable before xdg-settings.
Sign in to join this conversation.
No Branch/Tag specified
master
upstream-deb
openvpn-persistent
1.x
4.7.2
4.7.1
4.7.0
4.6.0
4.5.1
4.5.0
4.4.99.0
4.4.0
4.3.1
4.3.0
4.2.99.1
4.2.99.0
4.2.1
4.2.0
4.1.99.0
4.1.3
4.1.2
4.1.1
4.1.0
3.1.1
4.0.1
4.0.0
pr-3.3.1
pr-3.3.0
pr-3.2.0
3.1.0
3.0.0
2.2.1
2.2.0
2.1.0
2.0.0
1.1
1.0.3
1.0.2
1.0.1
1.0rc17
1.0rc16
1.0rc15
1.0rc14
1.0rc13
1.0rc12
1.0rc11
1.0rc10
1.0rc9
1.0rc8
1.0rc7
1.0rc6
1.0rc5
1.0rc4
1.0rc3
1.0rc2
1.0rc1
0.8
0.7.2
0.7.1
0.7
0.6.1
0.6
0.5.1
0.5
0.3
0.2.1
0.2
0.1.1
0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eduVPN/linux-app#692
Reference in a new issue
eduVPN/linux-app
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?