Typically, disabling JS (e.g. with NoScript) prevents most of the annoying dialogs like this. Also it helps with some paywalls. Of course, it adds a bunch of other annoyances with websites which won't work properly without JS (that is, most of them).