A similar scam happened to one of my mom's coworkers, except on her computer. It had an official-looking FBI seal and said something like "We have detected evidence of child pornography on this computer, to unlock it pay XX amount via (some obviously bullshit avenue)." However, being a student of criminal laws, I knew that possessing child porn is a felony and they would have just come and arrested her instead of pulling that sort of crap. I forget how they got it fixed, but nobody had to pay any money.
Ah yes, the "you've been looking at porn/terrorism/bad things." (Nice that they don't know what you've looked at, but it's bad???) You can pretty much just force kill the process and restart your browser.
I've had multiple calls from Microsoft support who have hung up on me rather than explain why they're monitoring my Sky internet connection or my Google Chrome browser or my Apple Mac. Also had a few from BT saying they were cutting off my internet connection. Never gave a reason why they were doing that nor why they had the power to cut off a connection for someone who isn't one of their customers. I string them along for my own amusement.
I've received phone calls from scammers who pretend to be from Microsoft. If I have the time, then I take the opportunity to pretend to be incompetent with computers, until I get bored or they hang up on me. I once told them exactly what I thought about them. The scammer told me I was right about them being a scammer and then she just hanged up on me. It seems better to play along for a bit or ignore them
If it's on your phone, just disable javascript on your phone's internet browser (if you have an iPhone). You'll be able to get rid of the popup then.
My mom got a text from some scammer once, freaked her out even though she knew it was bullshit. I haven't gotten a threat, but I've gotten those stupid ones that are like "you're our 1,000th visitor! You win _____" which are sometimes hard to click out of.