[Portland-bugs] [Bug 15185] New: xdg-open BROWSER usage is back-to-front ( if defined && in DE then DE takes precedence instead of env taking precedence )
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Sun Mar 23 20:54:35 PDT 2008
http://bugs.freedesktop.org/show_bug.cgi?id=15185
Summary: xdg-open BROWSER usage is back-to-front ( if defined &&
in DE then DE takes precedence instead of env taking
precedence )
Product: Portland
Version: beta2
Platform: x86 (IA32)
OS/Version: Linux (All)
Status: NEW
Severity: minor
Priority: medium
Component: xdg-utils
AssignedTo: portland-bugs at lists.freedesktop.org
ReportedBy: kentfredric at gmail.com
Generally, if one manually sets an ENV variable in their profile, one wants it
to be abided by.
This became notable to my attention when PSI( psi-im.org ) stopped providing a
manual browser selection as it deemed xdg-open suitable for opening links.
But lo and behold, for us poor kde users, that means using anything other than
konqueror as the default web-browser in KDE = an exercise in Xdg-open being
useless.
when xdg-open detects you are using KDE, it will just use kfmclient to handle
urls, regardless of the ENV variable BROWSER.
When this is something other than a KDE application, kfmclient downloads the
given URL into /tmp, and then calls whatever browser you set with konqueror to
open that now local file ( and potentially rising to a local-machine exploit
risk )
My friend and I, experienced the same problem and had the same agreeance on how
it should be best handled, and it appeared more practical to us that xdg-open
honour any manually set BROWSER string regardless of desktop environment, and
only fall back to the desktop environment handling in the event no $BROWSER
value was set ( noting of course, the desktop environment can set this itself,
but it is still able to be overridden on a scope level instead of it having to
propagate system wide )
While this would add some inconsistency as to how kde vs xdg-open oriented
clients would function, it appears setting $BROWSER is not done normally anyway
so it can be interpreted as an 'i know what this does' option.
I have manually altered my own bash script to replace this :
-------------------------------
if [ x"$DE" = x"" ]; then
# if BROWSER variable is not set, check some well known browsers instead
if [ x"$BROWSER" = x"" ]; then
BROWSER=firefox:mozilla:netscape
fi
DE=generic
fi
---------------------------------
with this:
---------------------------------
if [ x"$BROWSER" = x"" ]; then
if [ x"$DE" = x"" ]; then
BROWSER=firefox:mozilla:netscape;
DE=generic;
fi;
else
DE=generic;
fi
---------------------------------
and it 'works for me' and behaves how i expect it to.
xdg-open http://www.google.com #==> google.com in konqueror
BROWSER="firefox" xdg-open http://www.google.com #==> google.com in firefox
without stupid kfmclient downloading the file.
I was tempted of the idea of trying to work out what application was calling
xdg-open and load config info from a ~/.whatever file and load browsers based
on calling application when chosen, but heh, just an idea :)
( for what its worth, on gentoo using x11-misc/xdg-utils-1.0.2-r1 )
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Portland-bugs
mailing list