in reply to Re: Perl Windows Open a Web Browser
in thread Perl Windows Open a Web Browser

If you have mozilla installed (unlikely), and if it's in PATH (very unlikely), then it'll probably work on Windows too. Most likely it'll even work with Firefox as the browser (though maybe under a different name).

However, I hate programs that make assumptions on what your favourite software is (or should be, according to them). Usually, it's programs that open up HTML pages in MSIE, irrespective of what your default browser is...

Replies are listed 'Best First'.
Re^3: Perl Windows Open a Web Browser
by Corion (Patriarch) on Apr 10, 2007 at 10:59 UTC

    No - the Mozilla mozilla -remote thing does not work on Windows - as far as my investigations went back in the days of HTML::Display, FireFox/Mozilla do not offer any ways of remotely controlling a browser window, unlike Internet Explorer.

      Well, I tried
      "C:\Program files\Mozilla Firefox\firefox.exe" -remote openURL(http:// +google.be)
      on Windows with Firefox 1.5.x, and it did properly open the requested in a new tab. So things might have improved...

      However, the requirement for the full path is very impractical. Firefox is a GUI program, and there's really no need for it to be in PATH. So typically, it isn't.

      And, there appears to be no need for the arcane command line syntax, just an URL as an argument seems to work too.

      "C:\Program files\Mozilla Firefox\firefox.exe" http://google.be

      update: Corion, who is lucky enough to have Firefox as his default browser (corporate policies, meh!), says the command line in the registry looks like

      "C:\Program files\Mozilla Firefox\firefox.exe" -url "%1"
      %1 is the command line argument, either an URL or a file path, and the quotes around it are just for any spaces in a path of a html file. So there you have it, the officially recommended command line.
Re^3: Perl Windows Open a Web Browser
by Errto (Vicar) on Apr 11, 2007 at 04:40 UTC
    The ShellExecute technique suggested by Jenda will cleanly, consistently, without hanging, cause your default browser, whatever that is, to browse to the URL you tell it. Whether it does so in a new window or existing window depends on how you configure the browser itself. Now, as for controlling that browser window afterwards, that's another story...