Post by Mattias GaertnerPost by Felipe Monteiro de Carvalho"mozilla-firefox www.google.com" and if firefox is already open, it
will open the page without opening a new instance. I tested here, try
on your command line with firefox already open. If you want it to open
a new instance, there is probably a command line switch for this.
See examples/openbrowser/ how to do that with mozilla, galeon, firefox,
konqueror, netscape and opera.
Actually I find users PREFER having browser calls open in tabs, if they
already have a copy of firefox open, they usually do not want to end up with
another instance (once people get used to tabs, they fall in love with them,
I know I did).
Here is the way I handled browsing in OpenBook btw. you may edit/use if it
suits you:
Helper := '';
{$IFDEF Linux}
if shell('which opera') = 0 then
Helper := 'opera';
if shell('which mozilla') = 0 then
Helper := 'mozilla';
if shell('which konqueror') = 0 then
Helper := 'konqueror';
if shell('which firefox') = 0 then
Helper := 'firefox';
{$ENDIF}
If Helper = '' then
Begin
LocateFRM.Label2.Caption := 'a web browser';
LocateFRM.ShowModal;
If LocateFRM.ModalResult = MrOK then
Helper := LocateFRM.Locator.Text else
begin
ShowMessage('Error: Install a web browser !');
Application.Terminate;
end;
end;
Config.Add('BROWSER='+Helper);
-----
As you can see I check for the existence of opera, mozilla, konqueror and
firefox in that order, e.g. if both konqueror and firefox are in the user's
path then firefox will win, if none of these are there, I show a dialog
allowing the user to select his own browser command.
I use a similar function to get a PDF viewer as wel.
A.J.
--
A.J. Venter
Chief Software Architect
OpenLab International
www.getopenlab.com
www.silentcoder.co.za
+27 82 726 5103