#!/bin/sh
# If firefox is already running, send it a command.
# If started without arguments, open a new window, else a new tab.

if firefox -a firefox -remote "ping()" 2> /dev/null ; then
    if [ -z "$1" ]; then
	firefox -a firefox -remote "xfeDoCommand (openBrowser)"
    else
	firefox -a firefox -remote "openURL($1,new-tab)"
    fi
else
    firefox $1 &
fi
