Prevent Safari 10.x from auto-downloading files?
To stop Safari from automatically downloading files (and instead ask you with a prompt before downloading):


Open Safari, and go to Safari -> Preferences in the menubar (or hit command+,)







Go to the General tab and hit the dropdown next to File download location. Choose Ask for each download.






Now, if I navigate to the download page for something (for example, the 1Password browser extension) and download it, a download prompt will appear before the file begins to download:





Indeed, the file does not download until I click Save. If I click Cancel, the downloads menu shows me that Zero KB of the file was downloaded:



Asking before each download is a great way to prevent malicious DMGs from being downloaded onto your Mac, but you can read this great answer that explains why these steps I've outlined are completely unnecessary, because DMGs can't harm your computer until you manually install them.

Instructions and images for Safari 10.0.1.