those pop ups that goes on while you are surfing the web can be blocked.
go click on safari, select safari extension, it will direct you to apple website, and download adblock
this will block those advertisement.
if they ask are you sure to leave the page, dont click yes or no, click the red x button on left top corner. or command +w