To set a permission given a {{PermissionDescriptor}}
- |descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, and an
- optional |origin|:
+ |descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, an
+ optional |origin|, and an optional |user agent|:
- Let |target origin| be [=current settings object=]'s [=environment settings
object/origin=] if |origin| is null, or |origin| otherwise.
- Let |targets| be a list containing all [=environment settings objects=] whose
- [=environment settings object/origin=] is [=same origin=] with |target origin|.
+ [=environment settings object/origin=] is [=same origin=] with |target origin|, and which
+ belong to the |user agent| if provided, or all user agents otherwise.
- Let |tasks| be an empty list.
@@ -1433,6 +1434,7 @@
descriptor: permissions.PermissionDescriptor,
state: permissions.PermissionState,
origin: text,
+ userContext?: text,
}
@@ -1459,6 +1461,9 @@
- Let |state| be the value of the `state` field of |command parameters|.
+ - Let |user context id| be the value of the `userContext` field of |command
+ parameters|, if present, and `default` otherwise.
+
- If |state| is an inappropriate [=permission state=] for any
implementation-defined reason, return [=error=] with [=error code=] [=invalid
argument=].
@@ -1470,7 +1475,11 @@
- Let |origin| be the value of the `origin` field of |command parameters|.
- - [=Set a permission=] with |typedDescriptor|, |state|, and |origin|.
+
- Let |user agent| be the [=user agent=] that represents the [=user context=]
+ with the id |user context id|.
+
+ - [=Set a permission=] with |typedDescriptor|, |state|, |origin|, and |user
+ agent|.
- Return [=success=] with data `null`.