[WORKED AROUND] Xfce Help not displayed when Opera is default web browser
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[WORKED AROUND] Xfce Help not displayed when Opera is default web browser
Hello
In case it helps anyone ...
In Xfce 4.6.1, with Opera 9.64 as the default web browser, Help from the Applications menu was not displayed with Opera giving error message "You tried to access the address http://'file///usr/share/xfce4/doc/C/index.html', which is currently unavailable". See the http: at the start of the URL; it should be file:///usr/share/xfce4/doc/C/index.html
ps showed the command being run to show help was /usr/lib/opera/9.64/opera -remote openURL('file:///usr/share/xfce4/doc/C/index.html',new-window)
Changing the default web browser from Opera to Firefox (3.5.2) solved the problem. Changed by Applications menu, Settings, "Xfce4 Settings", "Preferred Applications", "Web browser": "Mozilla Firefox".
In case someone wants to make Help work with Opera, the script that launches Help is /usr/bin/xfhelp4.
I haven't xfce installed, but the secret lies for sure in /usr/bin/xfhelp4. If it's a shell script we could edit it to make it always use firefox or whatever browser you want it to use. However, I think that opera can open local URIs as well, so the problem might be that the URI needs to be parsed and corrected a bit.
I haven't xfce installed, but the secret lies for sure in /usr/bin/xfhelp4. If it's a shell script we could edit it to make it always use firefox or whatever browser you want it to use. However, I think that opera can open local URIs as well, so the problem might be that the URI needs to be parsed and corrected a bit.
Try to paste the script here and I'll do my best.
Thank you for your kind offer but I'm OK with the workaround because Firefox is my preferred browser; I'd only configured Opera while running Gnome and Xfce simultaneously during the changeover (because Firefox got upset when run in two sessions).
Xfce has a preferred browser setting (Menu→Settings→"Xfce4 Settings"→ "Preferred Applications" then set "Web browser") so no need to modify /usr/bin/xfhelp4 for that.
You are right to say "opera can open local URIs as well"; when I tried pasting file:///usr/share/xfce4/doc/C/index.html into its address bar it worked OK.
Out of curiosity, I dug a bit deeper. The problem is not in /usr/bin/xfhelp4. That script only selects the URI and then calls /usr/bin/xfbrowser4 with the URI as the argument. /usr/bin/xfbrowser4 expects environment variable $BROWSER to be set (defaults otherwise) and then calls the browser with a browser-specific command line:
Code:
[snip]
if [ ! "x$1" = "x" ]; then
case $1 in
*://*) URL=$1;;
*) URL="file://$1" ;;
esac
fi
case $BROWSER in
firefox*)
$BROWSER -a firefox -remote openurl\($URL,new-window\) || \
$BROWSER $URL
;;
communicator*|netscape|mozilla*|phoenix*|firebird*)
$BROWSER -remote openurl\($URL,new-window\) || \
$BROWSER $URL
;;
opera*)
$BROWSER -remote openURL\($URL,new-window\) || \
$BROWSER $URL
;;
exo-open)
$BROWSER --launch WebBrowser $URL
;;
*)
$BROWSER $URL
;;
esac
[snip]
I guess the bug is in -remote openURL\($URL,new-window\).
Yes, so it seems. I think that even simply removing the opera*) section altogether would work, the general case *) should work for most browsers anyway. Certainly opera open local URIs ok by just doing "opera <localuri>". If you get the chance report it upstream, so they can fix it. It's quite trivial but I am sure that you are not the first one to be bothered by this bug, and you will surely not be the last one either.
Yes, so it seems. I think that even simply removing the opera*) section altogether would work, the general case *) should work for most browsers anyway. Certainly opera open local URIs ok by just doing "opera <localuri>". If you get the chance report it upstream, so they can fix it. It's quite trivial but I am sure that you are not the first one to be bothered by this bug, and you will surely not be the last one either.
The following command does work perfectly as you thought
Code:
opera file:///usr/share/xfce4/doc/C/index.html
Environment variable $BROWSER is not set, as I thought it might be, by setting Opera as the preferred browser in Xfce. Setting $BROWSER to opera is not a workaround because it results in two instances of Opera -- one showing Xfce Help and the other the default start page.
That leaves setting $BROWSER to anything not matched in the case statement as a workaround. export BROWSER='Internet Explorer' should do the trick!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.