plan9port/bin/web
2005-01-04 21:15:55 +00:00

50 lines
676 B
Bash
Executable file

#!/bin/sh
plumb1()
{
case x-$BROWSER in
# Other browsers here
# ...
*opera*)
$BROWSER -remote 'openURL('$i',new-page)'
;;
*firebird*)
$BROWSER -remote 'openURL('$i',new-window)'
;;
*firefox*)
$BROWSER -remote 'openURL('$i',new-tab)'
;;
x-)
# run firefox as default!
firefox -remote 'openURL('$i',new-tab)'
;;
*mozilla*)
$BROWSER -remote 'openURL('$i',new-tab)'
;;
x-*)
$BROWSER -remote 'openURL('$i',new-tab)'
;;
esac
}
if [ $# = 0 ]
then
plumb1 about:blank
else
for i
do
if [ -f "$i" ]
then
p=`pwd`
i=`cleanname -d $p $i`
i=file://$i
fi
plumb1 $i
done
fi
case $BROWSER in
*opera*)
$BROWSER -remote 'raise()'
esac