tell application "System Events"
	set myApp to name of first application process whose frontmost is true
	if myApp is "Camino" then
		tell application "Camino"
			set myURL to URL of window 1
		end tell
	else if myApp is "firefox-bin" then
		quit
	else if myApp is "Safari" then
		tell application "Safari"
			set myURL to URL of document 1
		end tell
	else
		return
	end if
end tell

do shell script "open -a firefox " & quoted form of myURL