That is a form of ransomeware, you call them and they charge you a few hundred dollars to pretend to disinfect
your computer. It is a scam and personally I would treat it the same way I treat COVID-19 or an IED. TeamViewer is a legitimate product, but that the h3!! do you need it for? All of this has absolutely nothing to do with Safari, or any other browser. It has to do with web sites you are visiting or perhaps a site you may have visited in the past that left something distasteful on your system. If you don't have a reliable anti-malware app running on your computer you should get one. I use the "Pro" version of MalwareBytes
because it is effective and unobtrusive, but there are a number of other anti-virus, anti-adware, apps listed in the App Store. NOTE:
All of the really effective ones require an annual subscription to keep their detection mechanisms up to date.