Re: [GD-Linux] opening a URL in the default browser

J C Lawrence <[email protected]> Sat, 13 Sep 2003 22:06:30 -0400
Newsgroups gmane.games.devel.linux
Message-ID <[email protected]>
On Sat, 13 Sep 2003 16:33:21 -0400 
Brian Hook <[email protected]> wrote:
> On Sat, 13 Sep 2003 19:53:41 +0200, Ignacio Casta=F1o wrote:

>> does somebody know if linux provides a generic way of opening an URL
>> using the default browser of the current desktop?

> I don't believe this is possible, you have to do some convoluted
> searching for the appropriate browser.  I _think_ I've seen some
> sample source code for this, and I know our own apps supports this.

Its actually not directly possible.  You can make a number of large
assumptions, and thus make an educated guess, but that's about it.

If They're running KDE and Konquerer is installed, then it is minimally
not an unlikely choice, but has no guarantees.  If they are running
Gnome, Gnome has a concept of a default handler for HHTP URLs, and the
user has set that preference (frequently not the case), and the browser
that the preference points to is even installed (may or may not be true,
then that is also a fairly reasonable guess.

If they're not running either KDE or Gnome then you really have no idea.
Just check the process table to see if you can find a browser being used
by the current user, and use that.  If that fails, just pick the first
recognisable thing you find off $PATH.

Or you could just ask the user...

-- 
J C Lawrence                
---------(*)                Satan, oscillate my metallic sonatas. 
[email protected]               He lived as a devil, eh?		  
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Gamedevlists-linux mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-linux
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=554