I've also been experiencing problems with pop-up ads from malware on Safari and Firefox. I did all of the checking we're told to do on forums such as seeing if there is anything unusual in the Activity Monitor, deleted cookies and so on. Today, I also got malware on Google Chrome. After spending a long, long time trying to work out how to remove malware from my Mac or from the browsers, I was left confused and unable to remove it. Downloading anti-virus software didn't help either, as these sort of pop-up ads are not considered to be harmful to the computer, so the software seems not to to detect it. But I came across and article suggesting that I go to 'extensions' within Safari (click on 'Safari' > 'preferences' > 'extensions') and delete those. I only had one extension which I deleted and that has solved the problem. Sure enough, I had the same extension in Firefox (click on 'Tools' > 'add-ons') and Google Chrome ('Chrome' > 'preferences' > 'extensions'). Once deleted in Chrome's 'extensions' or disabled in Firefox's 'add-ons', the pop-up ads have disappeared. So in the end, I discovered the malware was affecting the browsers and not the Mac itself. How the extension on the browsers got there, I don't know. But I was really surprised as the eventual solution was very simple.