I stumbled upon this very thing last month. It was indeed extremely difficult to get rid of it, in particular since I had a ton of tabs open and didn't want to kill the whole browser. Since the modal blocks the UI and blocks the JavaScript event loop, it blocks also all usual keyboard shortcuts inside the browser like CTRL+W for closing the tab.
Luckily the affected tab was in a separate window, and here comes the tip if you're on Windows:
You can click `Alt+Space` to have an OS-provided menu, in which there's an option to close the window.