[whatwg] Proposal for non-modal versions of modal prompts

Jochen Eisinger jochen at chromium.org
Mon Mar 19 13:38:56 PDT 2012


I'd like to put forward a proposal for extending the modal prompts
(alert/confirm/prompt) with an optional callback parameter. If the optional
callback parameter is present, the javascript execution would resume
immediately. The callback will be invoked when the dialog that doesn't need
to be browser modal now, is closed.

I wouldn't add such a callback to showModalDialog, as I think sites can use
e.g. window.open instead.

I've written up the proposal here: http://wiki.whatwg.org/wiki/Modal_prompts

The motivation for this is that in a tabbed browser, modal dialogs are
potentially disrupting the work flow of the user as they can't interact
with any other web site as long as the modal dialog is displayed.

Current browsers are having problems with the modal prompts:

Chromium for example doesn't display a window created by showModalDialog in
a modal way: http://crbug.com/16045

WebKit and Firefox don't suppress events while a modal dialog is running:
https://bugs.webkit.org/show_bug.cgi?id=78240 and

Firefox displays modal prompts as tab-modal. However, it's possible to
execute JavaScript in a tab that should be blocked by a modal prompt:
https://bugzilla.mozilla.org/show_bug.cgi?id=727397 and the prompts from
separate tabs can block each other:

Feedback on this proposal would be highly appreciated!


More information about the whatwg mailing list