xdg-open relies on $KDE_FULL_SESSION and $GNOME_DESKTOP_SESSION_ID ($DBUS_SESSION_BUS_ADDRESS would also be helpful), which we somehow need to funnel through pkexec. Without that, it just calls x-www-browser which has no idea about the user's preferred browser.
xdg-open relies on $KDE_FULL_SESSION and $GNOME_ DESKTOP_ SESSION_ ID ($DBUS_ SESSION_ BUS_ADDRESS would also be helpful), which we somehow need to funnel through pkexec. Without that, it just calls x-www-browser which has no idea about the user's preferred browser.