You can set Safari to block the pop-up windows displayed by some webpages.
Open Safari if it is not already open.
Choose Safari > Block Pop-Up Windows so that a checkmark appears next to it.
Blocking pop-up windows stops only those windows that appear when you open or close a page. It does not block pop-up windows that open when you click a link.
If you block pop-up windows, you might miss important information for a webpage. For example, a website that provides services to you might use a pop-up window to request your user name.