Re: Thoughts on WebNotification

On Thu, Jun 24, 2010 at 8:00 PM, Doug Turner <doug.turner@gmail.com> wrote:
> Thank you for your quick response!
>
> On Jun 24, 2010, at 11:48 AM, John Gregg wrote:
>
>> On Thu, Jun 24, 2010 at 11:38 AM, Doug Turner <doug.turner@gmail.com> wrote:
>> I have been thinking a bit on Desktop Notifications [1].  After reviewing the Web Notification specification [2], I would like to propose the following changes:
>>
>>
>> 1) Factor out the permission api into a new interface and/or spec.  The ability to test for a permission without bring up a UI would improve the UX of device access.  I could imagine implementing this feature for use with Geolocation as well as notifications.  For example:
>>
>> interface Permissions {
>>
>> // permission values
>> const unsigned long PERMISSION_ALLOWED = 0;
>> const unsigned long PERMISSION_UNKNOWN = 1;
>> const unsigned long PERMISSION_DENIED  = 2;
>>
>> void checkPermission(in DOMString type, in Function callback);
>>
>> }
>>
>> Then we could do something like:
>>
>> navigator.permissions.checkPermission("desktop-notification", function(value) {});
>>
>> or
>>
>> navigator.permissions.checkPermission("geolocation", function(value) {});
>>
>>
>> I like this idea, I think it's definitely preferable to a one-off permission system just for notifications.
>>
>> Your proposal doesn't have a way to explicitly request permission.  Would you be willing to add that, with the recommendation that it only take place on a user gesture?  I don't think this eliminates the ability to implement request-on-first-use, if that's what Mozilla prefers, but I also still think there is benefit to allowing permissions to be obtained separately from invoking the API in question.
>
> so, checkPermission and requestPermission.  I am happy with that......
>
> and....
>
> if really want to get crazy, we could do something like:
>
> navigator.permissions.requestPermission("geolocation,desktop-notification",...).
>
> This would allow a site to request multiple permissions in one go.... up to the implementation if this is supported (i'd argue), and up to the implementation on how best to handle these requests.
>
>
>> The bigger question is, are other features interested?  Would the Geolocation spec consider using something like this for permissions?
>
> cc'ing Andrei Popescu - the editor of the Geolocation spec.  Not sure how to formally answer your question.  However, if the permission api above was implemented, I think it naturally follows that "geolocation" would be one of the known strings.
>

I think it's reasonable. On the other hand, do you think the Geo spec
needs changing to allow this? As I read it, I think it already allows
it.

Thanks,
Andrei

Received on Friday, 25 June 2010 13:01:02 UTC