W3C home > Mailing lists > Public > public-tracking@w3.org > March 2012

Re: JS Exception API

From: Nicholas Doty <npdoty@w3.org>
Date: Thu, 8 Mar 2012 14:37:53 -0800
Cc: Jonathan Mayer <jmayer@stanford.edu>, Tom Lowenthal <tom@mozilla.com>, "public-tracking@w3.org" <public-tracking@w3.org>, Andy Zeigler <andyzei@microsoft.com>
Message-Id: <5BCBD47A-EA48-4122-A35A-1312A19E3C4D@w3.org>
To: Roy T. Fielding <fielding@gbiv.com>
On Mar 7, 2012, at 5:25 AM, Roy T. Fielding wrote:

> On Mar 6, 2012, at 4:25 PM, Nicholas Doty wrote:
> 
>> On Feb 29, 2012, at 12:38 PM, Jonathan Mayer wrote:
>> 
>>> Minor suggestion for adding at the end of the "JavaScript API for site-specific exceptions" section:
>>> 
>>> The `callback` function may not be called.  For example, the user may decline to express a preference, dismiss the exception request, or close the browser window.
>> 
>> That's a good point. We could change this guidance:
>> 
>>>         A user agent MAY use an interactive method to ask the user about
>>>         their preferences, so sites SHOULD NOT assume that the callback
>>>         function will be called immediately.
>> 
>> to:
>> 
>>> A user agent MAY use an interactive method to ask the user about their preferences, so sites SHOULD NOT assume that the callback function will be called immediately or at all. For example, the user may dismiss the exception request or close the browser window.
> 
> Closing the browser window I can understand, but why wouldn't
> the callback be made as false if the request is dismissed?
> It makes the API pretty pointless if the page logic
> cannot rely on an answer and yet the window remains open.

Maybe dismissing the request isn't the ideal example, though I expect that depends on the browser implementation [0]. If the browser asks the user a question with a non-modal dialogue, the user may simply never answer, even as they leave the window open and continue to interact with content on the page. I think there are useful APIs where an open window doesn't guarantee that JavaScript receives an answer.

Thanks,
Nick

[0] For example, Chrome provides a non-modal information bar dialog when a site asynchronously requests geolocation permission. In addition to "Allow" and "Deny" buttons, I can just click a small "X" to dismiss the request, which does not call the error callback.
Received on Thursday, 8 March 2012 22:38:05 UTC

This archive was generated by hypermail 2.3.1 : Friday, 21 June 2013 10:11:26 UTC