There is this nifty free app called LinCastor that enables you to register your own handler for an URL. Although it had beed designed to register your own non-standard URL schemes, it can intercept standard http and https as well.
In LinCastor (which you need to double-click twice to fully open for editing):
- Add a new URL scheme
- Choose AppleScript handler
on handle_url(args) if (|URL| of args starts with "https://mail.google.") then tell application "Google Chrome" open location |URL| of args end tell else if (|URL| of args starts with "http://") then tell application "Firefox" open location |URL| of args end tell else tell application "Safari" open location |URL| of args end tell end return 1 end
[crarko adds: I tested this, and it works as described. LinCastor requires OS X 10.8 or later. I tried it in 10.10 beta 2, and it also worked there. There's not much documentation for it, so tinker around a bit to get the result you want.]

