Inspired and based off of https://gist.github.com/defunkt/318247, since that script didn't work with my environment, I decided to improve on it.
You need to have bash installed, but this was also tested in zsh so feel free to change the hashbang, apart from that the only thing you need to do is to set the $BROWSER environment variable.
$ export BROWSER="firefox" # or "chromium-browser" or "chrome" or any browser you want