[whatwg] Sychronous operations in onclose handlers

Tab Atkins Jr. jackalmage at gmail.com
Wed Aug 22 09:42:35 PDT 2012


On Wed, Aug 22, 2012 at 8:50 AM, Mark Watson <watsonm at netflix.com> wrote:
> Hi everyone,
>
> I heard that there was some discussion of banning the use of synchronous operations within document onclose handlers.
>
> Whilst it is obviously bad to hold up the closing of a document - especially indefinitely - I wondered what the solution was for applications that need to perform some final communication with an application server - say using XHR - when the document is closed ? Is it possible that events could continue to be handled for some short time after the onclose completes ? Something else ?
>
> I understand that there are cases where this is not possible - such as sudden loss of power - but that does't mean it isn't useful to be able to perform such operations in the normal, common, case.

I worked through a proposal for this exact problem a few months ago:
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-May/035686.html>

Hixie hasn't burned through enough of his backlog to work on it yet,
but if you have further comments, perhaps you could add them to that
thread.

~TJ



More information about the whatwg mailing list