In the past I've recommend using a script blocker (and perhaps also ad blocker) in a web browser to block malicious scripts and ads. Just learned about a new evolution – an HTML firewall. The extension is named: uBlock Origin (origin as in “original”). You no longer need to build white lists of allowed sites, rather it uses published lists of sites to block (default includes list used by Ad Block Plus). It works well right out of the box but you can customize it with additional lists lists to use, or customization like disable all 3rd party scripts, or scripts from specific sites. Works with Chrome, Firefox and Safari (just stop using IE if you do use it now) on all OSes. Just search for available extensions for your browser and search for uBlock Orign.