And thnks for ScamZapper recommendation, Randt!
ScamZapper's is a nice, free product for Safari. It was mostly designed to block the type of pop-up ad that makes it seem as if your browser is frozen, making it appear that you are trapped and can't escape (sometimes asking for a ransom, or for you to call a phone number where the scammers will try to con you into giving them access to your computer via remote control).
https://sites.google.com/site/appleclubfhs/downloads/scamzapper-info
This type of pop-up is a bit of JavaScript often known as "scareware".
See this article to learn all about scareware:
Scary Internet Scam Becoming Disturbingly Common
http://tidbits.com/article/15777
However, ScamZapper is unnecessary if you upgrade to Safari 9.1 or later (the latest being Safari 10, which comes with Sierra and which can be downloaded for El Capitan and Yosemite from the Mac App Store).
Safari 9.1 and later already have been updated to keep your browser from being apparently frozen if you encounter scareware.
See:
http://tidbits.com/article/16360
"...prevents JavaScript dialogs from blocking access to other Web pages"
Safari also already has technology that will protect you from malicious Web sites. That technology, oddly enough, comes from Google, and it is called Google Safe Browsing. In fact, Safari, Firefox and Chrome all have Google's "Safe Browsing" technology built-in. Google's Safe Browsing protects you from poisoned Web sites, drive-by downloads, and phishing sites, etc..
http://www.macworld.com/article/137094/2008/11/safari_safe_browsing.html
Google Safe Browsing uses a database that is very frequently updated. Sometimes multiple times a day.
Which is all a long-winded way of saying that instead of downloading ScamZapper, you can simply update your copy of Safari to 9.1 or later and you will be protected from malicious Web sites.