What I do is a greater waste of time -- I have a separate browser profile for each individual site that I might log into, and javascript is only whitelisted for that one site in that profile. It's a real pain because whenever my browser adds a new config option, I have to update the settings in each of the ~20 profiles.
It has saved me a few times where some rogue javascript tries to redirect me to some unexpected site, and the destination site simply doesn't load.