#!/bin/bash --norc


	for arg; do

		case "$arg" in

		-remote)
			;;

		http:* \
	|	https:* \
	|	/*)
			url="$(echo -n "$arg" |sed -e 's/,/%2c/g')"
			;;

		file:*)
			url="$(echo -n "$(ap "${arg#file:}")" |sed -e 's/,/%2c/g')"
			;;

		*)
			url="$(echo -n "$(ap "$arg")" |sed -e 's/,/%2c/g')"
			;;

		esac


		echo "firetab \"$arg\"; url=\"$url\"" >>"$HOME/.fireopen.log"

		/opt/mozilla/lib/mozilla-xremote-client -a firefox "openURL($url, new-tab)" 2>~/.xsession-errors

	done
