Hello,
In Safari there are some settings you will want to make sure you have enabled. In addition, since you mention your antivirus free trial, some unsavory app developers can actually cause some worrying things to occur, hoping to get a user to subscribe to their service. If your free trial came with an app or Safari extension you may want to remove it to see if that stops from occurring.
Allow or block pop-ups in Safari on Mac - Apple Support
"Allow or block pop-ups on all websites
- In the Safari app on your Mac, choose , then click Websites.
- Click Pop-up Windows on the left.
- If you don’t see Pop-up Windows, be sure to scroll to the bottom of the list.
- If there are websites listed below Configured Websites, and you want to change the settings for these sites (for example, they’re set to Allow, but you want to change them to Block), select each website, then click Remove.
- If you don’t see Configured Websites, either you haven’t set pop-up blocking for any sites yet, or you’ve cleared the list.
- Click the “When visiting other websites” pop-up menu, then choose one of the following:
- Allow: Pop-ups for the websites appear.
- Block and Notify: Pop-ups for the website don’t appear, but when you visit a website with blocked pop-ups, you can choose to show them by clicking the Show button in the Smart Search field.
- Block: Pop-ups for the websites don’t appear.
If you block pop-ups on a website, but you continue to see pop-ups on the website, you might have unwanted software on your Mac. See the Apple Support article Block pop-up ads and windows in Safari."
Change Security settings in Safari on Mac - Apple Support
Block pop-up ads and windows in Safari - Apple Support
"If adware or other unwanted software is installed on Mac
If you see pop-ups on your Mac that just won’t go away, you might have unintentionally downloaded and installed adware (advertising-supported software) or other unwanted software. Certain third-party download sites might include software that you don’t want along with the software that you do.
If you think that you might have malware or adware on your Mac:
- Update to the latest version of macOS. If your Mac is already using the latest version, restart your Mac. macOS includes a built-in tool that removes known malware when restarting.
- Check your Applications folder to see if you have any apps that you don't expect. You can uninstall those apps.
- Check the Extensions tab in Safari settings to see if you installed any unnecessary extensions. You can turn extensions off.
If you continue to see advertising or other unwanted programs on your Mac, contact Apple."
I hope this helps.