Discord-AppImage icon indicating copy to clipboard operation
Discord-AppImage copied to clipboard

Can't open links in Firefox

Open TheToto opened this issue 6 years ago • 6 comments
trafficstars

Hello, (I'm on ArchLinux) When i try to open a link from Discord (with firefox as default browser), it doesn't work ; Because after setting LD_LIBRARY_PATH to appimage lib folders :

$ xdg-open https://google.fr           
XPCOMGlueLoad error for file /usr/lib/firefox/libxul.so:                                                                                     
/home/toto/discord/squashfs-root/usr/lib/x86_64-linux-gnu/libssl3.so: version `NSS_3.33' not found (required by /usr/lib/firefox/libxul.so)
Couldn't load XPCOM.

So Discord can't open links because firefox fails to open with appimage libs. Some tips/workaround ?

TheToto avatar Aug 10 '19 11:08 TheToto

I cannot reproduce this. Make sure Firefox is set as your default browser in xdg-settings. Setting the LD_LIBRARY_PATH has nothing to do with opening a browser.

LD_LIBRARY_PATH is set to include the existing directories, so it's not affecting how programs that are already installed on your system work.

simoniz0r avatar Sep 18 '19 15:09 simoniz0r

Can reproduce. A popup opens, saying Failed to execute default Web Browser. Input/output error. Opening links works correctly with the discord-installer package. Running xdg-open www.example.com opens a tab in Firefox as expected.

junetried avatar Mar 02 '20 16:03 junetried

I reproduce this issue too. Will see if there is a way to make some kind of wrapper than unset some environment variables.

XPCOMGlueLoad error for file /usr/lib/firefox/libxul.so:
/tmp/.mount_discorSPl0X1/usr/lib/x86_64-linux-gnu/libssl3.so: version `NSS_3.80' not found (required by /usr/lib/firefox/libxul.so)
Couldn't load XPCOM.

I don't have any popup opening, I had to check the console output from Discord.

Exagone313 avatar Feb 28 '24 21:02 Exagone313

I can confirm that unsetting LD_LIBRARY_PATH in an xdg-open wrapper will fix the issue.

There are probably more informations on this GitHub issue: https://github.com/NixOS/nixpkgs/issues/160923

I do not use nixOS, but it probably has more in depth informations. For example, it seems to happen with some other appimages too.

For the record, here is the value I get for this environment variable:

LD_LIBRARY_PATH=/tmp/.mount_discorSPl0X1/usr/lib/:/tmp/.mount_discorSPl0X1/usr/lib/x86_64-linux-gnu:

And an example wrapper:

#!/bin/sh
# discord sets this variable which breaks wayland apps
unset GDK_BACKEND
# discord app image sets this
if [ -n "${APPDIR}" ]; then
	unset LD_LIBRARY_PATH
fi
exec /usr/bin/xdg-open "$@"

Exagone313 avatar Feb 28 '24 23:02 Exagone313

I can confirm that unsetting LD_LIBRARY_PATH in an xdg-open wrapper will fix the issue.

There are probably more informations on this GitHub issue: NixOS/nixpkgs#160923

I do not use nixOS, but it probably has more in depth informations. For example, it seems to happen with some other appimages too.

For the record, here is the value I get for this environment variable:

LD_LIBRARY_PATH=/tmp/.mount_discorSPl0X1/usr/lib/:/tmp/.mount_discorSPl0X1/usr/lib/x86_64-linux-gnu:

And an example wrapper:

#!/bin/sh
# discord sets this variable which breaks wayland apps
unset GDK_BACKEND
# discord app image sets this
if [ -n "${APPDIR}" ]; then
	unset LD_LIBRARY_PATH
fi
exec /usr/bin/xdg-open "$@"

This isn't an acceptable fix, but it does suggest that libraries are at fault for this issue, which I've suggested before but it was quickly shot down.

junetried avatar Feb 29 '24 01:02 junetried

After thinking about this, the only things I can think of that are bundled that could cause this are libnspr4 and libnss3 as those are both used by Firefox. I will try building three test AppImages to see if one or both of those are the issue.

simoniz0r avatar Apr 29 '24 06:04 simoniz0r

This should be fixed by 0d7929b. Please try redownloading the AppImage from the releases page and let me know if this does not fix the issue for you.

simoniz0r avatar May 07 '24 02:05 simoniz0r