Re: JS Exception API

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