update March  6, 2005
NAME
browser.csh - Launch a default browser from another application
SYNOPSIS
browser.csh  URL
browser.csh  path/filename
browser.csh  filename

DESCRIPTION

This script solves several of the problems associated with launching a browser from another application eg. to read documentation. Instead of calling a specific browser, each application should be configured to call browser.csh.
  1. Choice of browsers - Many programs have a configuration file which specifies the command to use for starting a browser. This should always be set to 'browser.csh'. The actual command for launching the browser is set in the environment variable BIRCH_NETSCAPE. This can either be set to a command in the user's $PATH (eg. 'mozilla') or a fully-qualified path (eg. /usr/bin/mozilla).
  2. Older browsers require special arguments to open a new brower window if an instance of the browser is already running. Specifically, if  Netscape 7.1 or earlier was already open, and you try to launch a new window (eg. netscape http://home.cc.umanitoba.ca~psgendb) you will get a message saying that the browser is already runing, and asking whether you want to run using a different profile. If the environment variable BROWSER_OPENURL is set to 1, broswer.csh automatically detects whether a the browser is already running. If so, it launches the browser specified in BIRCH_NETSCAPE using a command in the following form:

    netscape -remote openURL(http://www.linux.org,new-window)

    This is only needed for older browsers. For newer browsers (eg. mozilla 1.73 and later) BROWSER_OPENURL should be set to 0. If you're not sure what your browser does, try first setting this variable to 0, and if it doesn't work then set it to 1.

  3. When opening files on the local system, most browsers require a full URL ie. file://path/filename. If you omit 'file://' or a fully-qualified path, browser.csh will automatically add them. For example, the command

    browser.csh $doc/Phylip/main.html

    might generate the corresponding command

    mozilla /home/psgendb/doc/Phylip/main.html


ENVIRONMENT
BIRCH_NETSCAPE
BROWSER_OPENURL

AUTHOR
Dr. Brian Fristensky
Department of Plant Science
University of Manitoba
Winnipeg, MB  Canada R3T 2N2
frist@cc.umanitoba.ca
http://home.cc.umanitoba.ca/~frist