Re: [whatwg] suggestions for the Notifications API (http://notifications.spec.whatwg.org/)

2013-05-05 Thread Andrew Wilson
On Fri, May 3, 2013 at 6:49 PM, Nils Dagsson Moskopp <
n...@dieweltistgarnichtso.net> wrote:

> alonn  schrieb am Fri, 3 May 2013 18:50:36 +0300:
>
> > 1. Having a way to check for the current permission without
> > initiating a new Notification object first. something like webkit has
> > (I'm not sure it's not deprecated)
> > window.webkitNotification.checkPermission() I saw this isn't in the
> > api, and I think having this would be a great
>
> Scenario: “You need to enable notifications to view this web site.”
>
> With less sarcasm: I think this can and will be horribly abused.
>

To be clear, this capability exists in the current API. We've basically
discussed this permission flow to death already, and have come to consensus
around why having an explicit permission flow is needed to address key use
cases. Do you have a new use (or abuse) scenario that this group has not
considered previously?


>
> --
> Nils Dagsson Moskopp // erlehmann
> 
>

---
Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Katherine Stephens


Re: [whatwg] suggestions for the Notifications API (http://notifications.spec.whatwg.org/)

2013-05-04 Thread alonn
On Fri, May 3, 2013 at 7:49 PM, Anne van Kesteren  wrote:

> On Fri, May 3, 2013 at 4:48 PM, alonn  wrote:
> > 1. Having a way to check for the current permission without initiating a
> > new Notification object first. something like webkit has (I'm not sure
> it's
> > not deprecated) window.webkitNotification.checkPermission()
> > I saw this isn't in the api, and I think having this would be a great
>
> >>That would be Notification.permission. You can request using
> >>Notification.requestPermission(callback).
>
> Actually not, permission exists only on the notification instance . I was
> thinking a class method like requestPermission
>


> > 2.having a collection to iterate over notification instances  (from my
> page
> > only).
>
> We might get this at some point. See the recent notifications threads.
>
>
> > 3.having to set the "title" only when initiating the Notification object,
> > instead in the dictionary NotificationOptions Iooks inconsistent to me.
> my
> > instinctive attempt was to set the title together with the rest of the
> > notification options. but that won't work. I think it belongs there  (or
> at
> > least, also there)
>
> >>Only title is required, basically. It's similar to how new Event()
> behaves.
>


>  I think a more suitable example would be Geolocation api (
> http://dev.w3.org/geo/api/spec-source.html#get-current-position) another
> api that calls functionality outside the browser window.

where all the options are passed in the options dictionary  the title could
default to empty string or "title" like the rest of the options.

and after looking in the geolocation api again I think maybe having a
callback function as a third optional argument to the notification
constructor, instead of attaching an 'onshow' events


>
> --
> http://annevankesteren.nl/
>


Re: [whatwg] suggestions for the Notifications API (http://notifications.spec.whatwg.org/)

2013-05-04 Thread alonn
>>"With less sarcasm: I think this can and will be horribly abused"
not sure why and how this could be abused but since this can be achieved
otherwise (checking if denied and if isn't denied show the "please press
here to enable notifications" logic) doesn't look too important.

cheers

אלון ניסר
a...@noal.org.il
054-6734469


On Fri, May 3, 2013 at 7:49 PM, Nils Dagsson Moskopp <
n...@dieweltistgarnichtso.net> wrote:

> alonn  schrieb am Fri, 3 May 2013 18:50:36 +0300:
>
> > 1. Having a way to check for the current permission without
> > initiating a new Notification object first. something like webkit has
> > (I'm not sure it's not deprecated)
> > window.webkitNotification.checkPermission() I saw this isn't in the
> > api, and I think having this would be a great
>
> Scenario: “You need to enable notifications to view this web site.”
>
> With less sarcasm: I think this can and will be horribly abused.
>
> --
> Nils Dagsson Moskopp // erlehmann
> 
>


Re: [whatwg] suggestions for the Notifications API (http://notifications.spec.whatwg.org/)

2013-05-03 Thread Nils Dagsson Moskopp
alonn  schrieb am Fri, 3 May 2013 18:50:36 +0300:

> 1. Having a way to check for the current permission without
> initiating a new Notification object first. something like webkit has
> (I'm not sure it's not deprecated)
> window.webkitNotification.checkPermission() I saw this isn't in the
> api, and I think having this would be a great

Scenario: “You need to enable notifications to view this web site.”

With less sarcasm: I think this can and will be horribly abused.

-- 
Nils Dagsson Moskopp // erlehmann



Re: [whatwg] suggestions for the Notifications API (http://notifications.spec.whatwg.org/)

2013-05-03 Thread Anne van Kesteren
On Fri, May 3, 2013 at 4:48 PM, alonn  wrote:
> 1. Having a way to check for the current permission without initiating a
> new Notification object first. something like webkit has (I'm not sure it's
> not deprecated) window.webkitNotification.checkPermission()
> I saw this isn't in the api, and I think having this would be a great

That would be Notification.permission. You can request using
Notification.requestPermission(callback).


> 2.having a collection to iterate over notification instances  (from my page
> only).

We might get this at some point. See the recent notifications threads.


> 3.having to set the "title" only when initiating the Notification object,
> instead in the dictionary NotificationOptions Iooks inconsistent to me. my
> instinctive attempt was to set the title together with the rest of the
> notification options. but that won't work. I think it belongs there  (or at
> least, also there)

Only title is required, basically. It's similar to how new Event() behaves.


--
http://annevankesteren.nl/


[whatwg] suggestions for the Notifications API (http://notifications.spec.whatwg.org/)

2013-05-03 Thread alonn
I played a little bit with the Notification API and I have a couple of
suggestions (I tried the chrome implementation with Mozille hacks jsFiddle
http://jsfiddle.net/robnyman/TuJHx/) for improvement (at least
in my view) or a more consistent API as web developer:

1. Having a way to check for the current permission without initiating a
new Notification object first. something like webkit has (I'm not sure it's
not deprecated) window.webkitNotification.checkPermission()
I saw this isn't in the api, and I think having this would be a great

*Real life usecase example:*I would like to show different content or apply
different logic for someone who didn't explicitly granted permission, but
didn't deny it either, without having to show the confirmation dialog first
and frighten them away.

2.having a collection to iterate over notification instances  (from my page
only).

3.having to set the "title" only when initiating the Notification object,
instead in the dictionary NotificationOptions Iooks inconsistent to me. my
instinctive attempt was to set the title together with the rest of the
notification options. but that won't work. I think it belongs there  (or at
least, also there)

I would also like to say that this can be a really useful api, and you're
doing a great work with it! thanks everyone for the great job!


[whatwg] suggestions for the Notifications API (http://notifications.spec.whatwg.org/)

2013-05-03 Thread alonn
I played a little bit with the Notification API and I have a couple of
suggestions (I tried the chrome implementation with Mozille hacks jsFiddle
http://jsfiddle.net/robnyman/TuJHx/) for improvement (at least
in my view) or a more consistent API as web developer:

1. Having a way to check for the current permission without initiating a
new Notification object first. something like webkit has (I'm not sure it's
not deprecated) window.webkitNotification.checkPermission()
I saw this isn't in the api, and I think having this would be a great

*Real life usecase example:*I would like to show different content or apply
different logic for someone who didn't explicitly granted permission, but
didn't deny it either, without having to show the confirmation dialog first
and frighten them away.

2.having a collection to iterate over notification instances  (from my page
only).

3.having to set the "title" only when initiating the Notification object,
instead in the dictionary NotificationOptions Iooks inconsistent to me. my
instinctive attempt was to set the title together with the rest of the
notification options. but that won't work. I think it belongs there  (or at
least, also there)

I would also like to say that this can be a really useful api, and you're
doing a great work with it! thanks everyone for the great job!