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

Ryosuke Niwa rniwa at webkit.org
Sun Jun 26 20:30:01 PDT 2011

On Sun, Jun 26, 2011 at 8:17 PM, Adam Barth <abarth at webkit.org> wrote:

> On Sun, Jun 26, 2011 at 8:12 PM, Alan Stearns <stearns at adobe.com> wrote:
> > On 6/26/11 12:10 PM, "Adam Barth" <abarth at webkit.org> wrote:
> >
> >> It would be useful to know what fraction of those users would have
> >> a
> > better experience with this change.  Sreeram, of the example sites
> > that
> >> you've seen, how many would be improved by suppressing
> >> these
> > alerts?
> >
> > One example of a useful confirm (I think) is a web-based irc client like
> > irc.w3.org. It warns that you will close all active IRC connections, and
> > lets you decide whether to stay on the page or navigate away.
> That's a beforeunload handler, which everyone agrees is useful.  We're
> discussing alert() dialogs during the unload event.

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.

- Ryosuke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110626/b3d3db80/attachment.html>

More information about the webkit-dev mailing list