I'm surprised that NoScript for Firefox hasn't had a mention. It blocks a lot of the evils of the internet but I have found that it can break certain pages or sites. To resolve this, it's easy to disable temporarily or for individual sites and I use Ghostery to block any trackers as well.