From 4d272fe1775a7b71d7af251bf2feedd2268ddd55 Mon Sep 17 00:00:00 2001
From: Peter Beverloo
Date: Tue, 24 Mar 2015 12:54:49 -0500
Subject: [PATCH] Add a PushSubscriptionOptions dictionary with a userVisible
option.
User agents may decide to display different UI when requesting push
permission from the user if the intended use of the subscription is to
only send messages which result in user visible UI, for example a
Web Notification.
This PR introduces this in the specification by accepting an optional
property bag to the subscribe() and hasPermission() methods. This bag
features a "userVisible" option that can be set to TRUE.
UAs are not required to follow this UI paradigm, but when they do, they
SHOULD enforce the requirement when receiving a push message. The exact
tools for "user visible UI" and enforcement are left undefined as
one can imagine multiple solutions for them, which we don't want to
capture in the specification.
---
index.html | 44 +++++++++++++++++++++++++++++++++++++++++---
1 file changed, 41 insertions(+), 3 deletions(-)
diff --git a/index.html b/index.html
index ee62f66..3a59666 100644
--- a/index.html
+++ b/index.html
@@ -68,6 +68,18 @@
]
},
],
+
+ localBiblio: {
+ "NOTIFICATIONS": {
+ title: "Notifications API",
+ href: "https://notifications.spec.whatwg.org/",
+ authors: [
+ "Anne van Kesteren",
+ ],
+ status: "Living Standard",
+ publisher: "WHATWG"
+ }
+ },
};
@@ -312,6 +324,10 @@
has been persisted, or a prearranged trust relationship applies. Permissions that are
preserved beyond the current browsing session MUST be revocable.
+
+ The user agent MAY consider the PushSubscriptionOptions
+ when acquiring permission or determining the permission status.
+
When a permission is revoked, all push subscriptions
created with that permission MUST be deactivated.
@@ -515,13 +531,13 @@
-
- Promise<PushSubscription> subscribe ()
+ Promise<PushSubscription> subscribe (optional PushSubscriptionOptions options)
-
Promise<PushSubscription?> getSubscription ()
-
- Promise<PushPermissionStatus> hasPermission ()
+ Promise<PushPermissionStatus> hasPermission (optional PushSubscriptionOptions options)
@@ -624,7 +640,7 @@
Return promise and continue the following steps asynchronously.
Retrieve the push permission status (PushPermissionStatus
) of the
- requesting webapp
+ requesting webapp.
If there is an error, reject promise with no arguments and terminate these
steps.
@@ -641,6 +657,28 @@
If there is a need to ask for permission, it needs to be done by invoking the
subscribe
method.
+