Firefox was not the problem. It sounds like you probably had adware installed that is known to modify the Firefox app. This isn't really a problem with Firefox, but with the adware that you installed. That adware could have been downloaded by any web browser, and it still would have done this when installed.
Be aware that this adware does not install itself. It got on your machine because you downloaded and installed something you shouldn't have, probably by being tricked into thinking you needed it or downloading something from the wrong site. For more information, and to learn how to avoid this in the future, see:
http://www.thesafemac.com/mmg-defense/