You are not logged in.

#1 2010-02-27 09:57:12

ashesxera
Member
From: Shanghai
Registered: 2010-01-17
Posts: 26
Website

How to set default file browser and web browser

I am using openbox as the window manager and don't have a desktop environment.
My file browser is pcmam file manager and my web browser is chromium.
I add

export BROWSER=/usr/bin/pcmanfm

in .bashrc so that the system uses pcman file manager to open a local file from an external application. But it will also uses pcman file manager to open a url. I want the url opened in chromium, but chromium doesn't let me set the default web browser (as the picture shows blow).:(
What shall deal with it?
Thank you.
4391977508_5256e250b5.jpg

Offline

#2 2010-02-28 03:55:59

ashesxera
Member
From: Shanghai
Registered: 2010-01-17
Posts: 26
Website

Re: How to set default file browser and web browser

Anyone please give me any advice?

Offline

#3 2010-02-28 05:42:15

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: How to set default file browser and web browser

Isn't "export BROWSER" for web browsers not file managers?

Also try "export DE=xfce && chromium-browser" and see if Chromium lets you set it as default browser then.

Offline

#4 2010-02-28 14:12:54

ashesxera
Member
From: Shanghai
Registered: 2010-01-17
Posts: 26
Website

Re: How to set default file browser and web browser

Thank you. But it seems not work well. Although added "export DE=xfce" into .bashrc enabled chromium to be the default web browser, chromium still can't open urls from external  applications. And to your question, "export BROWSER" made the application both web browser and file browser.

Offline

#5 2010-07-20 19:27:18

zilverling
Member
From: Bennekom, Netherlands
Registered: 2009-08-19
Posts: 82

Re: How to set default file browser and web browser

For years I used Firefox as my default web browser, but it is slowed down considerably as a result of over a hundred RSS feeds and several extensions (including echofon). I tested Chromium and the same functionality is delivered using less processor capacity. So I want to shift to Chromium.

In the process I discovered a strange and annoying problem related to the default web browser in XFCE. Chromium is displayed as default browser in Chromium->Options->Default Browser preferences and XFCE's Applications->Settings->Preferred Applications. When I give an exo-open from a terminal, Chromium opens a window.

However, Thunderbird/Lanikai keeps opening hyperlinks in Firefox. And if I remove Firefox (sudo pacman -Rns firefox) I get the following error message in the error console when clicking on a hyperlink:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIExternalProtocolService.loadUrl]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://communicator/content/contentAreaClick.js :: openLinkExternally :: line 188"  data: no]

I've looked around on fora, but so far I haven't found THE answer...

Browsing the web for a solution I came across the suggestion to add two lines to Lanikai's prefs.js:

string: network.protocol-handler.app.http; value: /usr/bin/chromium
string: network.protocol-handler.app.https; value: /usr/bin/chromium

But that doesn't help either, so I think the problem lies somewhere with the desktop environment (XFCE4 in my case).

Any suggestions towards a solution would be most welcome.

Offline

#6 2010-07-20 22:42:31

ks1
Member
From: Atlanta, Georgia
Registered: 2006-03-26
Posts: 62
Website

Re: How to set default file browser and web browser

Look into xdg-open for clues. xdg-mime should help.

http://www.trgtd.com.au/forum/viewtopic.php?f=26&t=2372


A little more in depth
http://linux.derkeiler.com/Mailing-List … 01743.html

one more (currently being posted/answered). Has an example of how to use xdg-mime
https://bbs.archlinux.org/viewtopic.php?id=101312

Last edited by ks1 (2010-07-20 22:48:18)

Offline

#7 2010-07-21 01:57:24

zilverling
Member
From: Bennekom, Netherlands
Registered: 2009-08-19
Posts: 82

Re: How to set default file browser and web browser

ashesxera: Thanks for the pointers!

After some hours of persistent puzzling I finally figured out how to make Thunderbird/Lanikai open URIs in Chromium instead of Firefox in the XFCE desktop environment.

In fact I found two solutions that both work.

1) The straightforward solution: make some changes to Thunderbird/Lanikai's prefs.js

Add two string variables:

string: network.protocol-handler.app.ftp; value: exo-open
string: network.protocol-handler.app.http; value: exo-open
string: network.protocol-handler.app.https; value: exo-open

and importantly: change the values of the Boolean variables network.protocol-handler.warn-external.ftp network.protocol-handler.warn-external.http and network.protocol-handler.warn-external.https to 'true'.

It turns out that for some unclear reason the standard Arch Linux Thunderbird/Lanikai package uses gnome-open to open URLs. The persistent popping up of Firefox was caused by some settings in .gconf that come with the gconfd package. I didn't find these values in gconf-editor.


2) Change xml files in .gconf
As I don't want to use Firefox as standard browser any longer, I wanted to get rid of these hidden settings in .gconfd so that "gnome-open [URI]" opens a webpage in Chromium.

I succeeded in getting there by replacing firefox with chromium in the following files:

.gconf/desktop/gnome/applications/browser/%gconf.xml
.gconf/desktop/gnome/url-handlers/chrome/%gconf.xml
.gconf/desktop/gnome/url-handlers/ftp/%gconf.xml
.gconf/desktop/gnome/url-handlers/http/%gconf.xml
.gconf/desktop/gnome/url-handlers/https/%gconf.xml
.gconf/desktop/gnome/url-handlers//%gconf.xml

Offline

#8 2010-07-21 02:54:07

zilverling
Member
From: Bennekom, Netherlands
Registered: 2009-08-19
Posts: 82

Re: How to set default file browser and web browser

Done some additional testing & have to conclude that solution 1 (changing prefs.js) does not work after all.

I found a thread on the MozillaZine forum that seems to refer to the same problem: Thunderbird 3 ignores network.protocol-handler.app.http

They write that setting the Network.protocol-handler.warn-external.ftp, Network.protocol-handler.warn-external.http and Network.protocol-handler.warn-external.https to true will do the job. But it doesn't in my case.

My conclusion is that if would would be much better if Thunderbird let the desktop environment choose which program handles urls (by relying on some open desktop protocol like the xdg-utils provided by the Portland initiative -- although that does not seem a very lively project).

I just wonder if there are any other projects trying to bring some unity across desktop environments?

Offline

Board footer

Powered by FluxBB