Re: [GD-Linux] opening a URL in the default browser
Brought to you by:
vexxed72
From: J C L. <cl...@ka...> - 2003-09-14 02:06:33
|
On Sat, 13 Sep 2003 16:33:21 -0400 Brian Hook <ho...@py...> 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. cl...@ka... He lived as a devil, eh? http://www.kanga.nu/~claw/ Evil is a name of a foeman, as I live. |