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

[whatwg] SQL storage and onunload

From: Alexey Proskuryakov <ap@webkit.org>
Date: Sun, 10 Feb 2008 23:21:07 +0300
Message-ID: <60738F4B-3496-44F7-B632-563EB80811F4@webkit.org>

On Feb 10, 2008, at 3:17 PM, Anne van Kesteren wrote:

> On Sat, 09 Feb 2008 22:06:39 +0100, Alexey Proskuryakov  
> <ap at webkit.org> wrote:
>> On Feb 9, 2008, at 12:58 PM, Anne van Kesteren wrote:
>>>> As far as the unload handler question, what are the semantics for  
>>>> XHR?
>>> I think the user leaving the page is the same as aborting the  
>>> download.
>>   I've seen servers (e.g. Google) use XHR in onunload to track  
>> usage statistics. Sounds like a reasonable use case (really, is  
>> there a better way?).
> How do you determine when you can end the process? It also seems  
> kind of icky that the window is already closed (as far as the end  
> user is concerned), but that code is still executing on behalf of it.

   I don't know - this doesn't currently work in WebKit. But it  
presumably works in other engines, given that there is code that uses  

   I don't think it's particularly evil to make a single XHR request  
from onunload, with an understanding that no response will be  
delivered. However for SQL storage, one cannot just execute a  
statement without asynchronously creating a transaction, which makes  
it even more tricky.

- WBR, Alexey Proskuryakov
Received on Sunday, 10 February 2008 12:21:07 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:39 UTC