Just to let everyone know how to prevent this thing from happening again.
This malware depends upon JavaScript, a web browser "script" or code that allows the web page to do more things.
Now in Safari preferences JavaScript can be turned off, but it makes some web pages not function as intended.
Going back into Safari preferences to turn JavaScript on/off can become tiresome.
For a bit more security and a downloads window warning before it occurs, I suggest using the Firefox web browser and the Add-on (from the Tools menu) called NoScript.
https://www.mozilla.com/en-US/firefox/fx/
What NoScript does is acts like a "web cop" combating all the webside trickery involved in making something like this malware to work on your computer.
https://addons.mozilla.org/en-US/firefox/addon/noscript/
Under Firefox's View> Customize ToolBar is a option to drag the NoScript "button" to the toolbar.
As you surf, you run with no scripts or plugins, if you need them (and trust the site) you can then click the NoScript button to turn them on.
If by rare chance you do happen to be on a web site with NoScript turned on and the malware site appears, Firefox will display a download window and a chance for you to opt out/cancel, not just blindly allows the download to occur.
So there is two steps to protect you from being a victim again.
And if you need more protection, like children who click on everything, there is the Add-on called "Public Fox" which you can set a password on the downloads and other things so the browser is locked down.
https://addons.mozilla.org/en-US/firefox/addon/public-fox/
Good luck.