That is your issue with Firefox or your setup. I never had this for at least one or two years now, even with misbehaving scripts.
The project to fix all this is called e10s. Moving Content, and UI etc to seperate process as well as OMTx ( Off Main Thread Everything ) where Firefox Dev trys to do everything in async style and move them off Main Thread.
Progress has been slow. But at least they are working on it
Chrome and IE have their issues too, like thrashing memory a lot sooner than FF, which is why FF is still the default browser on my laptop and netbook despite its unresponsive UI under heavy load.