W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

[whatwg] salvaging work while navigating away from a web app -- onunload="confirm('save before quitting?')

From: Bil Corry <bil@corry.biz>
Date: Fri, 12 Dec 2008 13:17:39 -0600
Message-ID: <4942B8D3.90907@corry.biz>
Ojan Vafai wrote on 12/12/2008 12:49 PM: 
> If we're going for matching what browsers do, there's a number of cases
> (different in each browser) where the confirm doesn't popup. In Chrome, for
> example, if the beforeunload handler takes too long, we kill it and navigate
> away. Similarly, in Firefox, if the beforeunload handler hits the limit for
> script execution and the user stops the script, the beforeunload handler
> never fires.
> Not sure what the right language for that is. But developers try to do
> things like using beforeunload/unload to release locks, make server
> requests, etc. and it's just not a very reliable thing to do in any browser.
> It's really just useful for the quick prompt for the user as to things like
> unsaved changes.

Here's a fun one, I made this as a demo to show how a website could trap a user forever:


I haven't tried it in any browsers lately, but a quick test with IE7 shows it still is effective (for it at least).

- Bil
Received on Friday, 12 December 2008 11:17:39 UTC

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