diff --git a/notifications.bs b/notifications.bs index 5686bd6..43ec345 100644 --- a/notifications.bs +++ b/notifications.bs @@ -291,40 +291,21 @@ removed from the list of notifications. "notification center" (if available). -
Notifications can only be displayed if the -user (or user agent on behalf of the user) has granted permission. -The permission to show notifications -for a given origin is one of three strings: - -
default
"
- This is equivalent to "denied
", but the user has made no
- explicit choice thus far.
-
-
denied
"
- This means the user does not want - notifications. +
granted
"
- This means notifications can be - displayed. -
The Notifications API is a powerful feature which is identified by the +name "{{PermissionName/notifications}}". [[!Permissions]] -
There is no equivalent to "default
"
-meaning "granted
". In that case
-"granted
" is simply returned as there would be no reason
-for the application to ask for permission.
+
To get the notifications permission state, run these steps: -
Let permissionState be the result of getting the current permission state + with "{{PermissionName/notifications}}". -
The Notifications API is a powerful feature which is identified by the string -"notifications" and has its allowed in non-secure contexts flag set. -[[!Permissions]] +
If permissionState is "prompt
", then return "default
".
-
This specification's "default
" permission
-state maps to the [=permission/prompt=] permission state in the Permissions API.
+
Return permissionState. +
Run these steps in parallel:
If permission for notification's origin is not
- "granted
", then queue a task to fire an event named error
- on this, and abort these steps.
+
If the result of getting the notifications permission state is not
+ "granted
", then queue a task to fire an event named
+ error
on this, and abort these steps.
Run the fetch steps for notification. @@ -735,8 +716,7 @@ constructor steps are:
The static permission
getter steps are to
-return the permission for the current settings object's
-origin.
+return the result of getting the notifications permission state.
If you edit standards please refrain from copying the above. Synchronous permissions are like @@ -760,27 +740,14 @@ method steps are:
Let global be the current global object. -
Let permissionDescriptor be the {{PermissionDescriptor}} with
- {{PermissionDescriptor/name}} set to "notifications
".
-
-
Let permissionStatus be the result of - creating a `PermissionStatus` for - permissionDescriptor. -
Let promise be a new promise in this's relevant Realm.
Run these steps in parallel:
Run the permission query algorithm with - permissionDescriptor and permissionStatus. - -
Let permissionState be permissionStatus's - {{PermissionStatus/state}}. - -
If permissionState is {{PermissionState/"prompt"}}, then set
- permissionState to "default
".
+
Let permissionState be the result of + requesting permission to use "{{PermissionName/notifications}}".
Queue a global task on the DOM manipulation task source given global @@ -1083,7 +1050,7 @@ method steps are:
Run these steps in parallel:
If permission for notification's origin is not +
If the result of getting the notifications permission state is not
"granted
", then queue a global task on the
DOM manipulation task source given global to reject
promise with a {{TypeError}}, and abort these steps.