[webkit-dev] The case for disallowing alerts in unload, redux

Sreeram Ramachandran sreeram at chromium.org
Sun Jun 26 23:48:12 PDT 2011


On Sun, Jun 26, 2011 at 20:30, Ryosuke Niwa <rniwa at webkit.org> wrote:
> I've started to think that we should just kill modal dialogs in unload event
> and leave modal dialogs during unbeforeload and other events alone.  While
> things happen in unload isn't guaranteed to run before the page is evicted
> (navigated), beforeunload is guaranteed to happen before the navigation, and
> there seems to be a valid use case of modal dialogs during the event.
> In fact, if the motivation was to close a window/tab quickly, then there's
> no benefit in disabling modal dialogs in beforeunload because we'll have to
> wait until the event handler finishes running anyways.

I think the performance benefit and reduction in code complexity are
secondary. Reducing user annoyance is the number one priority.
Allowing modal dialogs during beforeunload doesn't help with that. I'd
prefer to keep things consistent and just disallow all modal dialogs
in all types of unload handlers (beforeunload, pagehide and unload).


More information about the webkit-dev mailing list