W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2010

[whatwg] prompts, alerts and showModalDialog during beforeunload/unload events

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 11 Mar 2010 02:44:36 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1003110242410.21376@ps20323.dreamhostps.com>
On Thu, 11 Feb 2010, Ojan Vafai wrote:
>
> Currently, modal dialogs that fire during beforeunload/unload events are 
> used to confuse users into not being able to leave websites (e.g. to 
> tell the user to click on the wrong button for in the browser's 
> beforeunload alert dialog). They also add a layer of complexity to 
> browser shutdown behavior. I can't think of any legitimate use-case for 
> opening a modal dialog when a user is trying to navigate away from a 
> page.
> 
> Proposal: Opening a modal dialog during beforeunload/unload should 
> either throw an error or just silently fail.

I haven't made a change to the spec here. I do believe, however, that it 
would be perfectly reasonable for a user agent to offer the user the 
choice to stop supporting JavaScript from any modal prompt. Other possible 
ways of handling this are to make the alerts tab-modal only, and to still 
allow navigation using the UI (location bar) while one of these "modal" 
dialogs is up, and simply aborting all running scripts when that is done.

Basically, I think this is a UA UI issue, and out of scope for the spec.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 10 March 2010 18:44:36 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC