Sadly almost all these comments are wrong. I work in a computer shop and we see the scam you’re talking about all the time. It happened because you unknowingly opened an ad. So you clicked on a button that looked legitimate like “download” or “next” or whatever, and that pops up full screen. The fix is a good ad blocker like ublock origin. Google’s being a piece of shit right now about ad blockers so I recommend something Firefox-based for effective ad blocking.
Watch it for the plot.