(In reply to Boris Zbarsky [:bz] from comment #8) > Or we could have a "in unload prompt" flag that gets propagated to timeouts > set while that flag is set and any code those timeouts run etc.
var gotbeforeunload = false; setInterval(function() { if (gotbeforeunload) { location.href = "foo"; } }, 100); onbeforeunload = function() { gotbeforeunload = true; };
would defeat that, AIUI. :-(
(and I've seen patterns like this in use on trappy sites before :-( )
Really, the whole beforeunload thing needs to go away, but then there's the rest of the web to think of. :-(
(In reply to Boris Zbarsky [:bz] from comment #8)
> Or we could have a "in unload prompt" flag that gets propagated to timeouts
> set while that flag is set and any code those timeouts run etc.
var gotbeforeunload = false; function( ) {
setInterval(
if (gotbeforeunload) {
location.href = "foo";
}
}, 100);
onbeforeunload = function() { gotbeforeunload = true; };
would defeat that, AIUI. :-(
(and I've seen patterns like this in use on trappy sites before :-( )
Really, the whole beforeunload thing needs to go away, but then there's the rest of the web to think of. :-(