Eric Raymond had an idea to solve this problem,
http://www.catb.org/~esr/BROWSER/index.html, too bad it doesn't seem to have taken off. Most applications that need to open something in a browser window have a config option; for a little shell script that might be overkill, though. Instead, you could parse the output of the whereis command to find out, for example.
Code:
whereis firefox | awk '{ print $1; }'
Then you could just do this for different browsers until you find one that works.