I had some trouble with Emacs opening html files in the wrong browser recently. Thanks to this post on stackoverflow made by Pierre-Antoine I realized why that other browser kept opening html files. It's because somewhere deep down in the many lines of e-lisp a script called "sensible-browser" is being called. Among other things, it checks the user environment variable BROWSER to see what is it set to.
So to fix this I opened .profile and added this line: