Does not work in Leopard
set bundleID to do shell script "defaults read com.apple.LaunchServices | grep -A5 \"http\""
if bundleID contains "com.apple.safari" then
tell application "Safari" to activate
else if bundleID contains "org.mozilla.firefox" then
tell application "Firefox" to activate
end if