Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librewolf: cannot open new URLs into running instance 3 #6413

Closed
Lonniebiz opened this issue Jul 21, 2024 · 12 comments · Fixed by #6473
Closed

librewolf: cannot open new URLs into running instance 3 #6413

Lonniebiz opened this issue Jul 21, 2024 · 12 comments · Fixed by #6473

Comments

@Lonniebiz
Copy link

Firejail Version: 0.9.72
Debian 12
LibreWolf AppImage 128.0-2:

This issue was previously fixed in #4891 and #5227. Yet after upgrading to LibreWolf AppImage 128.0-2 the problem has returned.

Here's the command I'm using to run LibreWolf:
firejail --appimage --profile=/etc/firejail/librewolf.profile ~/AppImages/LibreWolf.x86_64.AppImage

The problem occurs after first launch, when I'm trying to open additional web pages. For example, let's say LibreWolf is already running, and I want to open Ebay from the command line:
firejail --appimage --profile=/etc/firejail/librewolf.profile ~/AppImages/LibreWolf.x86_64.AppImage https://www.ebay.com

Instead of opening Ebay into a new tab, I get this error:
"Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile."

@glitsj16
Copy link
Collaborator

FYI, Librewolf offers .deb files: https://librewolf.net/installation/debian/. Can you test if your issue changes when you don't use an AppImage?

@kmk3 kmk3 changed the title Can't Launch New URLs into Running Instance of LibreWolf librewolf: cannot open new URLs into running instance Jul 21, 2024
@kmk3
Copy link
Collaborator

kmk3 commented Jul 21, 2024

Basic debugging information is missing; please follow the bug report template:

@kmk3 kmk3 added the needinfo More information is needed from the issue author label Jul 21, 2024
@kmk3
Copy link
Collaborator

kmk3 commented Jul 21, 2024

Does it still happen with firejail-git?

What is the output in trace.txt in the following command?

firejail --trace=trace.txt --appimage \
  --profile=/etc/firejail/librewolf.profile \
  ~/AppImages/LibreWolf.x86_64.AppImage https://www.ebay.com

@Lonniebiz
Copy link
Author

Lonniebiz commented Jul 23, 2024

@kmk3 : After initially launching LibreWolf successfully, here's the output of the command you provided (that fails to open Ebay into a new tab):

2024-07-23_10-12
View trace.txt.

This wasn't an issue in the previous version of LibreWolf (v127.0-2), it only started happening again (#4891, #5227) in the latest v128.0-2.

I think significant changes were made to LibreWolf starting in version 128.0-2. I say this because after downgrading back to v127.0.2-2, I got a message upon launch saying that I could no longer load my browser-profile touched by v128.0-2. 128.0-2 apparently modified my browser-profile in a manner where v127.0.2-2 could no longer read it. I had to restore my LibreWolf browser-profile from a backup before I could load it again in v127.0.2-2.

For applications not in the debian repository, I only run AppImages (with FireJail), and I avoid installing .deb files from websites. However, I did attempt to grant your request of testing a .deb install of LibreWolf in a VM; Launching without firejail worked, but I couldn't get firejail to launch the deb installed version. Hopefully, this is a separate issue that can just be avoided due to the other info I've provided.

@stormtheory
Copy link

stormtheory commented Jul 27, 2024

Try using --name=sandyfox
--name creates a sandbox name and every firejail you create with that name will link them together. You can also join a sandbox so use --join=sandyfox but I found that --join isn't needed, after a lot of testing to fix this for me, a couple of days ago.

Please note that the use of --nodbus will break the joining of two firefox seesions and you will get: "Firefox is already running, but is not responding."

This works in firefox and I even wrote a python script wrapper for firejail to handle all this. I have a handler/wrapper sitting at /usr/bin/firefox to make all the commands and my options and translates then runs all commands for firejail and firefox. HA, if that makes sense. So whenever a program or a GUI wants to open a webpage, it is always sandbox'd and working, creating new windows or tabs.

@Lonniebiz
Copy link
Author

Lonniebiz commented Aug 27, 2024

@stormtheory : I tried using --name=sandyfox and even --join=sandyfox, but have the same problem. Only the first command launches LibreWolf. Subsequent commands all get the same error I screen captured above. I need subsequent commands to all launch into new tabs within the already launched browser without error.

@stormtheory
Copy link

stormtheory commented Aug 28, 2024

@Lonniebiz I just tried this and it worked in Firefox. In your librewolf.profile make sure of the following is set in order for it to talk on the dbus or the instances won't be able to talk:

dbus-user filter
ignore dbus-user none

Run commands like this but with your profile and LibreWolf command. I'm able to open many tabs from different terminals to one sandbox.

firejail --profile=/sandbox/firefox.profile --name=sandyfox firefox
firejail --profile=/sandbox/firefox.profile --name=sandyfox firefox --new-tab www.google.com

https://github.com/stormtheory/firefox-firejail-wrapper

@Lonniebiz
Copy link
Author

Lonniebiz commented Aug 28, 2024

@stormtheory : My custom profile does indeed contain:

dbus-user filter
ignore dbus-user none

The difference is that I'm specifically trying to accomplish this using the latest AppImage of LibreWolf (version 129.0.2-1) which is located here:
https://gitlab.com/api/v4/projects/24386000/packages/generic/librewolf/129.0.2-1/LibreWolf.x86_64.AppImage

So, when I try the arguments you're suggesting, with this exact AppImage, they look like this:

firejail --appimage --profile=/home/user1/.config/firejail/librewolf.profile --name=sandyfox ~/AppImage/LibreWolf.x86_64.AppImage

firejail --appimage --profile=/home/user1/.config/firejail/librewolf.profile --name=sandyfox ~/AppImage/LibreWolf.x86_64.AppImage --new-tab www.google.com

Yet, upon running the 2nd command, I'm getting the error I screen captured in a prior post. I simply can't launch new tabs from the command line.

Previously, in LibreWolf v127.0-2 AppImage, I was able to launch new tabs from the command line without getting that error (even without --name=sandyfox), but in every version after v127.0-2, I've found no way to launch new tabs from the command line without error.

@kmk3 kmk3 changed the title librewolf: cannot open new URLs into running instance librewolf: cannot open new URLs into running instance 3 Aug 28, 2024
@kmk3
Copy link
Collaborator

kmk3 commented Aug 28, 2024

#4897 added io.gitlab.librewolf.*; is that what Librewolf is currently using?

Does it work if you remove all dbus-related entries from all the relevant
.profile and .local files?

I'd try using something like busctl or d-feet to inspect what dbus commands
Librewolf is using.

@kmk3
Copy link
Collaborator

kmk3 commented Aug 31, 2024

@Lonniebiz

What is the dbus name returned in the following?

busctl --user | grep librewolf

It appears as io.gitlab.firefox.* to me, which is different from the
io.gitlab.librewolf.* name that is in librewolf.profile (see #4897).

Does it work with the following in librewolf.local?

dbus-user.own io.gitlab.firefox.*

kmk3 added a commit to kmk3/firejail that referenced this issue Sep 11, 2024
It appears that LibreWolf 129 uses `io.gitlab.firefox.*` as the dbus
name.

Commands used to check the dbus name:

    $ busctl --user --no-legend | grep -v '^:' | grep librewolf |
      sed -E 's/(^[^ ]+\.)[^. ]+ .*/\1/'
    io.gitlab.firefox.

Commands used to test dbus communication:

    # Open a new browser instance:
    $ firejail --name=lwtest --ignore=name --ignore='dbus-user none' \
      --dbus-user=filter --dbus-user.own='io.gitlab.firefox.*' \
      --private --net=none --ignore=net /usr/bin/librewolf
    # In another shell, try to open a new tab:
    $ firejail --join=lwtest /usr/bin/librewolf --new-tab about:blank
    # Check that the new tab was opened

Related commits:

* c3f2996 ("Let programs outside librewolf sandbox open new tabs in
  librewolf (netblue30#4546)", 2021-09-19)
* a8ad9ca ("Update librewolf.profile: use new message bus",
  2022-02-03) / PR netblue30#4897
* 4211ee3 ("merges", 2022-02-04)

Fixes netblue30#6413.

Misc: This was noticed on netblue30#6444.

Reported-by: @Lonniebiz
@kmk3 kmk3 removed the needinfo More information is needed from the issue author label Sep 11, 2024
@Lonniebiz
Copy link
Author

Lonniebiz commented Sep 11, 2024

@kmk3 Thank you so much for taking the time to reproduce my issue and fix it.

I confirm that after adding dbus-user.own io.gitlab.firefox.*, to my custom profile, there after I was able to launch new tabs in the latest LibreWolf AppImage v130.0-3.

How long do you expect it will take before your changes land in Debian 12? Once there, I'll likely switch back to using the default profile.

@kmk3
Copy link
Collaborator

kmk3 commented Sep 12, 2024

Thank you so much for taking the time to reproduce my issue and fix it.

I confirm that after adding dbus-user.own io.gitlab.firefox.*, to my custom
profile, there after I was able to launch new tabs in the latest LibreWolf
AppImage
v130.0-3
.

All good, thanks for confirming.

How long do you expect it will take before your changes land in Debian 12?
Once there, I'll likely switch back to using the default profile.

Personally I'm working on a few fixes for new features before they ship.

Then the idea is to work on the release itself.

No ETA though.

kmk3 added a commit to kmk3/firejail that referenced this issue Sep 13, 2024
It appears that LibreWolf 129 uses `io.gitlab.firefox.*` as the dbus
name.

Commands used to check the dbus name:

    $ busctl --user --no-legend | grep -v '^:' | grep librewolf |
      sed -E 's/(^[^ ]+\.)[^. ]+ .*/\1/'
    io.gitlab.firefox.

Commands used to test dbus communication:

    # Open a new browser instance:
    $ firejail --name=lwtest --ignore=name --ignore='dbus-user none' \
      --dbus-user=filter --dbus-user.own='io.gitlab.firefox.*' \
      --private --net=none --ignore=net /usr/bin/librewolf
    # In another shell, try to open a new tab:
    $ firejail --join=lwtest /usr/bin/librewolf --new-tab about:blank
    # Check that the new tab was opened

Related commits:

* c3f2996 ("Let programs outside librewolf sandbox open new tabs in
  librewolf (netblue30#4546)", 2021-09-19)
* a8ad9ca ("Update librewolf.profile: use new message bus",
  2022-02-03) / PR netblue30#4897
* 4211ee3 ("merges", 2022-02-04)

Fixes netblue30#6413.

Misc: This was noticed on netblue30#6444.

Reported-by: @Lonniebiz
@kmk3 kmk3 closed this as completed in 4280cf4 Sep 13, 2024
kmk3 added a commit that referenced this issue Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging a pull request may close this issue.

4 participants