Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
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. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
On Mon, Feb 15, 2010 at 3:37 PM, Mike Hearn wrote: > Browsers could solve the editor use case by treating "close tab" as > "hide tab" for a minute or two before actually shutting down the page. Firefox today has undo close tab. And people have joked for years about undo quit application (I think we might have it too). The problem with "hiding" is that if a web page is running scripts, or retaining network connections, the web server might be expecting certain behaviors. If I'm playing a network "game", or using a network "irc" client, then when i close my window, my link to the game/server/channel closes, which means my server timers stop and people don't expect to be able to contact me. If for 2 minutes my irc client is still "open", then people will expect that i can receive messages, or the game will let me die because I'm not interacting with it.
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
On Mon, Feb 15, 2010 at 2:29 AM, Biju wrote: > I dont know whether you all saw list of people on > https://bugzilla.mozilla.org/show_bug.cgi?id=391834 > https://bugzilla.mozilla.org/show_bug.cgi?id=61098 Those two address a *completely* separate issue, that of someone running an infinite alert() loop. They can do that anywhere they want, and it has the same effect as in the beforeunload handler. Firefox just doesn't handle that well - Opera and Chrome, iirc, provide an option to ignore further modal dialogs from the domain once they've popped up several in a short amount of time. ~TJ
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
Browsers could solve the editor use case by treating "close tab" as "hide tab" for a minute or two before actually shutting down the page. Then the problem becomes, how do you make it obvious to users that they can get their work back by pressing a magic button somewhere? The modal quit loop is frequently used to try and make people download malware. It'd be nice to eliminate it in a backwards compatible manner.
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
I dont know whether you all saw list of people on https://bugzilla.mozilla.org/show_bug.cgi?id=391834 https://bugzilla.mozilla.org/show_bug.cgi?id=61098
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
Though I'm not sure what exactly Ojan is proposing we forbid? I think his suggestion is to forbid all of window.prompt, window.alert, and window.showModalDialog. Persumably window.confirm as well. Exactly. But we don't need a spec to tell that. It's 100% user agent feature, so you're free to have better or worse UI. Same could be said when the user right-clicks.
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
2010/2/11 Jonas Sicking > 2010/2/11 Scott González : > > I use dialogs in this fashion as well. Users get very frustrated when > they > > accidentally leave a page with unsaved content and this is the easiest > > improvement for most developers to make. > > However you can accomplish this using the onbeforeunload return value. > No need to open modal dialogs using showModalDialog/input()/alert() > etc. > You're correct and that's actually what I do. I didn't realize Ojan wasn't talking about this, even though the subject makes that pretty clear.
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
On Feb 11, 2010, at 7:42 PM, Jonas Sicking wrote: 2010/2/11 Scott González : On Thu, Feb 11, 2010 at 9:55 PM, Tab Atkins Jr. wrote: I commonly see them put to *good* use by editting applications, warning you if you attempt to leave the page without saving. It has saved me from accidentally lost effort just in the past few days in both my email and one of my wikis. I use dialogs in this fashion as well. Users get very frustrated when they accidentally leave a page with unsaved content and this is the easiest improvement for most developers to make. However you can accomplish this using the onbeforeunload return value. No need to open modal dialogs using showModalDialog/input()/alert() etc. The built-in beforeunload dialog lets you cancel leaving the page, but what if the page wants to offer the common three "Quit without Saving", "Save and Quit", "Cancel Quitting" options that native apps often do, when you close a window with unsaved work? (Mind you, I'm not sure that is great UI, and it might be preferable to just always save on quitting, but I can imagine interaction designers wanting the familiar interaction above.) Though I'm not sure what exactly Ojan is proposing we forbid? I think his suggestion is to forbid all of window.prompt, window.alert, and window.showModalDialog. Persumably window.confirm as well. I'd like to see some examples of modal dialogs (of whatever variety) being used abusively before rendering judgment. Regards, Maciej
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
2010/2/11 Scott González : > On Thu, Feb 11, 2010 at 9:55 PM, Tab Atkins Jr. > wrote: >> >> I commonly see them put to *good* use by editting applications, >> warning you if you attempt to leave the page without saving. It has >> saved me from accidentally lost effort just in the past few days in >> both my email and one of my wikis. > > I use dialogs in this fashion as well. Users get very frustrated when they > accidentally leave a page with unsaved content and this is the easiest > improvement for most developers to make. However you can accomplish this using the onbeforeunload return value. No need to open modal dialogs using showModalDialog/input()/alert() etc. Though I'm not sure what exactly Ojan is proposing we forbid? / Jonas
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
On Thu, Feb 11, 2010 at 9:55 PM, Tab Atkins Jr. wrote: > I commonly see them put to *good* use by editting applications, > warning you if you attempt to leave the page without saving. It has > saved me from accidentally lost effort just in the past few days in > both my email and one of my wikis. > I use dialogs in this fashion as well. Users get very frustrated when they accidentally leave a page with unsaved content and this is the easiest improvement for most developers to make.
Re: [whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
On Thu, Feb 11, 2010 at 8:25 PM, 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 commonly see them put to *good* use by editting applications, warning you if you attempt to leave the page without saving. It has saved me from accidentally lost effort just in the past few days in both my email and one of my wikis. ~TJ
[whatwg] prompts, alerts and showModalDialog during beforeunload/unload events
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. Ojan