Created attachment 138345 [details] [review] fix Even if $BROWSER is set, still prioritizes `xdg-mime query default x-scheme-handler/<schemetype>`. Version: ``` $ xdg-open --version xdg-open 1.1.2 ``` Steps to Reproduce: ``` $ BROWSER=echo xdg-open "https://bugs.freedesktop.org/" ``` Actual Behavior: opens given URL in default web browser (mine is firefox) Expected Behavior: run $BROWSER <url>, in this case `echo https://bugs.freedesktop.org/` if $BROWSER not found, fallback to xdg-mime defaults I've found a hackish workaround for the time being: ``` $ DISPLAY="" BROWSER=echo xdg-open "https://bugs.freedesktop.org/" https://bugs.freedesktop.org/ ``` I'm attaching a patch for the reordering of priorities to fix this Thanks, -- Marco Sirabella
I think this is by design... The fallback to using a browser is only used as a last resort.
Looking over this, the request I've made would open any URL that is not a local file with the $BROWSER variable only if set. This is http, but also ftp & others. I think it makes sense to prioritize a user-defined $BROWSER variable as the user has explicitly stated "I want to use this application(s) as my browser".
$BROWSER is still legacy (and will possibly be removed from xdg-utils in a future iteration). http/https related mimetypes are the modern equivalent to setting preferred browsers
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.