PermissionStore Class
The permissions that the user gave to the origins (https://w3c.github.io/permissions/#permission-store): the states read by navigator.permissions.query() (Permissions.Query). It plays the role of the permission prompts of a browser. The state of a permission that was not set is PermissionState.Prompt. A store can be shared by several browsing contexts (BrowsingContextOptions.Permissions), and used from any thread.
public sealed class PermissionStoreRemarks
The state is keyed by the top-level origin of the document that queries it (the permission key of the specification). The documents that are not allowed to use a feature by their permissions policy, and the documents and workers that are not secure contexts, see the permissions as PermissionState.Denied. Changing a state fires the change event of the PermissionStatus objects whose state changed.
Constructors
| Name | Description |
|---|---|
| PermissionStore() |
PermissionStore()
PermissionStore.cspublic PermissionStore()No documentation is available.
Methods
| Name | Description |
|---|---|
| GetState(string, string) | Returns the state of a permission for a top-level origin. |
| SetState(string, PermissionState) | Sets the state of a permission for every origin (and removes the states set for an origin). |
| SetState(string, string, PermissionState) | Sets the state of a permission for a top-level origin. |
GetState(string, string)
PermissionStore.csReturns the state of a permission for a top-level origin.
public PermissionState GetState(string name, string origin)SetState overloads
SetState(string, PermissionState)
PermissionStore.csSets the state of a permission for every origin (and removes the states set for an origin).
public void SetState(string name, PermissionState state)Parameters
namestring- The name of the powerful feature (e.g.
geolocation). statePermissionState- The new state.
SetState(string, string, PermissionState)
PermissionStore.csSets the state of a permission for a top-level origin.
public void SetState(string name, string origin, PermissionState state)Parameters
namestring- The name of the powerful feature (e.g.
geolocation). originstring- The serialization of the top-level origin (e.g.
https://example.com). statePermissionState- The new state.