A similar discussion (now closed) suggested enabling the flag:
opera://flags/#allow-popups-during-page-unload
How do I do that on a Mac? When I go to that page, I do not see such a flag.
Let me add that Firefox does not do this, and I get the message on a number of sites, so it appears to be Opera and not the site that is generating the message.