mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3881] discord: cannot open links in the browser #2439
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2439
Loading…
Add table
Add a link
Reference in a new issue
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?
Originally created by @realnc on GitHub (Jan 10, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3881
Discord is unable to open links when clicking on them in the chat window. When clicking a link, I get this error in the output log:
I tried adding
kde-open5toprivate-binindiscord-common.profile, but then I get this error:And this window appears:
When I run:
Or when running without firejail, everything works fine.
Steps to reproduce the behavior:
firejail discord.Environment
Checklist
https://github.com/netblue30/firejail/issues/1139)LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAMto get english error-messages.browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.debug output
@smitsohu commented on GitHub (Jan 19, 2021):
You'll need to go to the discord profile and find the offending line by commenting out everything (which is equal to
noprofile), and then uncommenting one line after the other.Wild guesses: If I recall correctly, kde-open5 creates files in temporary locations and then issues commands via D-Bus. So
--whitelist=~/.cacheor--ignore=private-tmpcould be something worth trying. To check if you are missing a file on the whitelist, run--ignore=whitelistand see if it works.@smitsohu commented on GitHub (Jan 19, 2021):
You could also try
firejail --build discord. After exiting the application it usually suggests a profile, which can be quite helpful in debugging.@jas0n098 commented on GitHub (Mar 23, 2021):
A good solution for this problem is to add gdbus to private-bin and by launching Discord with something like
env XDG_CURRENT_DESKTOP= KDE_FULL_SESSION= DE=flatpak discordThis will force xdg-open to open links with xdg-desktop-portal instead which is better suited for sandboxed environments.
@rusty-snake commented on GitHub (Mar 24, 2021):
@jas0n098 you are a genius. Why didn't I realize earlier that portals are exactly the right solution?
Until now I had a
/usr/local/bin/xdg-openscript that uses D-Bus+systemd to escape the sandbox.But this requires that the sandbox can execute shell-script and can talk to
org.freedesktop.systemd1which gives it full control oversystemd --user.So portals are better, but replacing this script with a script that talks to the portal would still require a shell in the sandbox, therefore I made it in C: https://gist.github.com/rusty-snake/5104dc53ce3e52eef86cc34d359aa10e
@ghost commented on GitHub (Mar 24, 2021):
The use/misuse of portals (I assume that includes xdg-desktop-portal) for sandbox escaping recently raised this RFC: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3943. Just adding it here for reference - things on the portal side are likely to undergo changes we need to be aware of.
@rusty-snake commented on GitHub (May 12, 2021):
I'm closing here due to inactivity, please fell free to request to reopen if you still have this issue.
@realnc commented on GitHub (Jan 3, 2022):
I just tried that and nothing happens. Discord doesn't start and I have to press ctrl+c to abort.
@realnc commented on GitHub (Jan 3, 2022):
I got it to work by commenting out these lines in
discord.profile:And these lines in
discord-common.profile:Furthermore, I had to comment out this in
electron.profile, otherwise the system tray icon in KDE is invisible (no icon is visible):It also works if I restore all the edited profiles and instead put this in my
discord.local:This might have something to do with the Firefox executable not being called
firefoxhere, but rather/usr/bin/firefox-bin, which is a wrapper to start Firefox which is installed in/opt/firefox. I have tried addingfirefox-bintoprivate-binandprivate-opt, but it doesn't seem to help.@shervinsahba commented on GitHub (Oct 16, 2022):
@jas0n098 's solution worked for me. Thanks! I'll be honest that I'm not familiar enough with firejail or flatpak to know why this worked...
Anyway, to log it for others: I made a
discord.localwithprivate-bin gdbus. Then launching Discord withenv DE=flatpak discordsufficed for links to open in Firefox under my actual profile.Prior to this I had tried
ignore private-binfor discord.local, which allowed links to open in Firefox under a brand new (i.e. blank) profile. That, though, was undesirable.@unhammer commented on GitHub (Dec 13, 2024):
Portals worked for me too. I needed this in the firejail profile:
and since it's using gtk's default browser settings instead of xfce, I changed my default browser with
@Ketrel commented on GitHub (May 2, 2025):
A recent discord update broke links opening for me, adding the quoted line to my firejail profile did the trick. I had already had the two envars.
@kmk3 commented on GitHub (May 2, 2025):
Does it currently work without the environment variables?
Are you using firejail >=0.9.74?
@Ketrel commented on GitHub (May 4, 2025):
I haven't tried removing the envars
@kmk3 commented on GitHub (May 4, 2025):
Can you try it?