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

Ryosuke Niwa rniwa at webkit.org
Sun Jun 26 13:19:24 PDT 2011


On Sun, Jun 26, 2011 at 12:38 PM, Sreeram Ramachandran <sreeram at chromium.org
> wrote:
>
> I did see a couple of confirm() calls in beforeunload. The examples I
> found were also annoying ("Are you sure you want to leave? Yes/No"),
> but I can imagine those could instead have been more useful ("Do you
> want to save some state? Yes/No"). I think if there are indeed such
> uses, they can be transformed into  something that returns a non-NULL
> value in beforeunload and then saves state.
>

"Do you want to save some state? Yes/No" seems like a valid use of confirm
because there are 3 possible actions users can take:

   1. Don't leave
   2. Save state and leave
   3. Discard state and leave

If the site just used beforeunload, it can't distinguish 2 and 3.

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


More information about the webkit-dev mailing list