RE: Default Web Browser



> -----Original Message-----
> From: gtk-list-bounces gnome org 
> [mailto:gtk-list-bounces gnome org] On Behalf Of Michael Ekstrand
> Sent: 12 February 2006 14:38
> To: gtk-list gnome org
> Subject: Re: Default Web Browser
> 
> On Sun, 12 Feb 2006 00:00:51 -0500
> Andrew Krause <andrew openldev org> wrote:
> > Is there a sure fire way of find the default browser on all Linux 
> > distributions or is there a 98% case that will work? Thanks 
> - Andrew 
> > Krause
> 
> Probably not. A good place to start would be looking at the 
> sources for Python's webbrowser module; it provides a 
> cross-platform mechanism for launching a reasonable browser. 
> Not sure how it detects the correct browser on Linux.
> 
> Likely places to find such a setting are the GCONF keys 
> mentioned in this thread, and also the BROWSER environment 
> variable (not very widely used, but someone with it set will 
> want it honored). KDE stores a browser setting somewhere, not 
> sure where. The *best* way is probably to use some sensible 
> mechanism for finding a initial default browser, and then 
> allowing the user to reconfigure. For example, Psi lets me 
> choose between GNOME Default, KDE Default, and Other for the 
> browser to open URL's. That mechanism seems to work quite well.
> 
> The x-www-browser only exists on Debian-based systems AFAIK.

Certainly check the $BROWSER variable.
Don't assume that a GTK+ program can always access GConf.  Not everyone
has it installed, I don't.

After trying that and the other things mentioned above you can try
locating some popular browsers on the path.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]