How to remove web virus scam from imac

Hi everyone,

I apologize if this is already covered. I tried searching but my app would crash every time I searched.

Anyway, a few days back I got a pop up tab in safari claiming "a site you visited has infected your computer.. yada yada yada" I know this in not real but it keeps popping up every time i try to go to the next page on the site. It could be a forum or blog or shopping site. Whenever i hit next page this message pops up and i cannot move forward to the next page.

It does not automatically pop up when i open safari, just when i try to move forward.

I have tried many solutions i have found online, such as disabling java, removing the file from the website thru the activity monitor, but it still occurs.

Can anyone point me in the right direction?
Jeez. That's frustrating.

I've not experienced anything like that (knock on wood) but I use CCleaner fairly regularly and that purges a lot of background cr*p.

I wonder too if you, in your solution hunt, you came across this? - How to Empty Cache in Safari for Mac OS X | OSXDaily

Or I might even try rolling back Safari via Time Machine to a date when it wasn't doing this - hopefully overwriting whatever pesky irritant got in.

I'm sure others will be able to offer the definitive answer...
Thank you! I will try those to see if they fix it.

Original thread: https://forums.imore.com/threads/how-to-remove-web-virus-scam-from-imac.379684/