You are not logged in.

#1 2023-07-31 17:16:33

Resident0123
Member
Registered: 2023-07-31
Posts: 5

Firefox xdg-open does not work

Title should be fairly self explanatory. I've been banging my head against this for quite some time.

Whenever I run

firefox --new-tab https://archlinux.org

or

xdg-open https://archlinux.org

I get a "Firefox  is already running but not responding" error.  Worth noting is that it does correctly work if firefox is not running.

I am using the awesome window manager but I have gotten the same issue on hyprland. I use arkenfox user.js with minimal overrides.

To troubleshoot, I've done the following:
* Created a separate profile
* Run in safe mode
* Disable extensions
* Uninstall firefox; delete ~/.mozilla
* Delete ~/.mozilla/xxxxxxx.default/.parentlock
* Run librewolf
* Run with and without the following environment variables:

export MOZ_DBUS_REMOTE=1
export MOZ_WEBRENDER=1
export MOZ_DISABLE_RDD_SANDBOX=1

To be honest, I'm not sure what these do but a friend recommended I tried them.

Last edited by Resident0123 (2023-08-01 21:10:43)

Offline

#2 2023-07-31 17:48:04

Resident0123
Member
Registered: 2023-07-31
Posts: 5

Re: Firefox xdg-open does not work

Forgot to mention, this is in my xinitrc:

session="${1:-awesome}"
exec dbus-launch --exit-with-session "$session" 2>"$HOME/.local/share/$session.log"
# exec "$session" 2>"$HOME/.local/share/$session.log"

I tried running it both without dbus-launch and with dbus-launch

Last edited by Resident0123 (2023-08-01 21:11:01)

Offline

#3 2023-07-31 19:25:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,127

Re: Firefox xdg-open does not work

Please use [code][/code] tags, the BBS vastly predates even the premeditation of markdown wink
Edit your post in this regard.

Then see the last link below (no dbus-launch, but include the scripts that import the session environment) and just  to be sure,

pacman -Qs portal

Online

#4 2023-08-01 21:34:24

Resident0123
Member
Registered: 2023-07-31
Posts: 5

Re: Firefox xdg-open does not work

Thanks for your response. I've edited my posts accordingly. I'm not sure what link you're referring to? If you're talking about 'your xinitrc is broken', it didn't provide much assistance. Here are the contents of the relevant files:

xinitrc:

#!/bin/sh

if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
  . "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile"
else
  . "$HOME/.xprofile"
fi

session="${1:-awesome}"
exec "$session" 2>"$HOME/.local/share/$session.log"

xprofile:

#!/bin/sh

xrandr --dpi 96 
xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources &
xrdbpid=$!
light -S 20 &

autostart="mpd xcompmgr pipewire lxpolkit remaps"
eval $(ssh-agent)

for program in $autostart; do
  pidof -s "$program" || "$program" &
done >/dev/null 2>&1

# This just sets my xrandr configs and sets a wallpaper.
(
  command -v autorandr && autorandr -c
  arpid=$!
) &
(
  [ -n "$arpid" ] && wait "$arpid"
  command -v setbg && setbg
) &
[ -n "$xrdbpid" ] && wait "$xrdbpid"

This is what your pacman command shows.

local/xdg-desktop-portal 1.16.0-3
    Desktop integration portals for sandboxed apps
local/xdg-desktop-portal-gtk 1.14.1-1
    A backend implementation for xdg-desktop-portal using GTK
local/xdg-desktop-portal-hyprland-git 1:r285.4d9ff0c-1
    xdg-desktop-portal backend for hyprland

Last edited by Resident0123 (2023-08-01 21:34:39)

Offline

#5 2023-08-01 21:36:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,127

Re: Firefox xdg-open does not work

The wiki wrote:

Note: At the very least, ensure that the last if block in /etc/X11/xinit/xinitrc is present in your ~/.xinitrc file to ensure that the scripts in /etc/X11/xinit/xinitrc.d are sourced.

Online

#6 2023-08-01 21:59:36

Resident0123
Member
Registered: 2023-07-31
Posts: 5

Re: Firefox xdg-open does not work

Hmm. That didn't appear to do much. For reference, I've edited my xinitrc like so:

if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
  . "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile"
else
  . "$HOME/.xprofile"
fi

for module in /etc/X11/xinit/xinitrc.d/*; do
  echo "Sourcing $module" >> ~/sourced  # for debugging purposes; the file was populated as expected
  . "$module"
done

session="${1:-awesome}"
exec "$session" 2>"$HOME/.local/share/$session.log"

Offline

#7 2023-08-02 05:55:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,127

Re: Firefox xdg-open does not work

I tried running it both without dbus-launch and with dbus-launch

You're now gonna have a not-degenerated session and access to the proper session dbus.

Do you still have any of

Run with and without the following environment variables:

in place?
While FF is already running:

(printenv; loginctl session-status) | curl -F 'file=@-' 0x0.st

Online

#8 2023-08-03 01:55:11

Resident0123
Member
Registered: 2023-07-31
Posts: 5

Re: Firefox xdg-open does not work

Hey. Thank you for your assistance; the issue has been resolved.

I briefly experimented on a Debian install and noticed that the problem still persisted (I have a separate home partition).  However, through this, I was able to deduce that the problem was definitely with the xdg desktop portals. For some reason, they simply weren't starting. In addition, after uninstalling them my GUI apps started significantly faster. My firefox was taking around 50 seconds to startup before but I ended up going desensitized to it, assuming that it was simply my machine being low end. That probably should've been a red sign earlier lol. The systemd logs for xdg-desktop-portal showed that the service was timing out for some reason.

At this point, I wish I could say I elegantly solved it with my excellent debugging skills but my patience simply wore thin and I ended up reinstalling Arch and now it magically works! This is a sad conclusion but at least I can finally use my computer like a normal person.

Should I mark this post as solved? This isn't really a satisfying solution so I think that would be bad. In any case, here are my configs:

The following environment variables:

export BROWSER=firefox
export MOZ_DBUS_REMOTE=1

pacman -Qs portal:

local/xdg-desktop-portal-gnome 44.1-2 (gnome)
    A backend implementation for xdg-desktop-portal for the GNOME desktop
    environment
local/xdg-desktop-portal-gtk 1.14.1-1
    A backend implementation for xdg-desktop-portal using GTK

I just simply didn't install hyprland yet and probably don't intend to since I'm content with awesome.

Thanks again. Also, thank you for your indirect assistance by responding to such a ludicrous amount of forum posts. I hope you have a good day smile

Last edited by Resident0123 (2023-08-03 02:07:05)

Offline

#9 2023-08-03 06:35:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,127

Re: Firefox xdg-open does not work

xdg-desktop-portal-gnome was broken and caused stalls in environments other than gnome, but iirc it got fixed w/ the latest release.
You might previously have ended up w/o any portal implementation (if you still have the old journals, you could check there)

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Online

Board footer

Powered by FluxBB