Re: [whatwg] Notifications: the ability to specify notifications behavior

On Thu, Aug 14, 2014 at 4:37 PM, Robert Bindar <robertbindar@gmail.com>
wrote:
>
> On 08/13/2014 04:36 PM, Jonas Sicking wrote:
> >
> >>     * vibration - vibrate the device
> >>     * silent - "true" means do not play a sound when firing the
> >> notification(the sound
> >>                     is enabled by default in firefox for OSX, not
available
> >> in Linux and Windows)
> >
> > The tricky thing with these is how to deal with situations when the
> > user has turned of audio or turned off vibration for notifications.
>
> If the user turned off/on audio/vibration then UA will ignore any app
specified
> behavior. The user defined settings will always take priority over these
> behaviors.
>
>
> > If the user has turned off audio for notifications, and the page
> > specifies "vibration: false", does that mean that this notification is
> > entirely silent? I suspect that's not what the user expected when
> > turning off audio.
>
> If the user had previously turned on the vibration for notifications,
then no,
> the device will still vibrate, but otherwise the notification will indeed
> be entirely silent.

On this note, it would be useful if content could query the UA for the
default behaviors of any notifications it would send. Also, it would be
nice to know which of these behaviors could be overridden by the "behavior"
options. Perhaps something like:

var promise = Notification.getBehaviors();
promise.then(function (behaviors) {}

with behaviors looking something like this:

{
  "vibrate": {
    "default": true,
    "overridable": false
  },
  ...
}

So, each behavior would have a default (which the system determines through
platform support and user settings), and whether or not the behavior is
overridable for the current content script. The way an app could have the
information necessary to degrade gracefully.

Received on Thursday, 14 August 2014 23:55:15 UTC