Optional
dialogWhether access request dialogs should remember the user's choice by default.
Optional
dismissThe number of times an access request can be dismissed before the permission is automatically blocked.
Optional
initialThe initial states of permissions in the store, as a map of permission descriptors to their initial access state.
As well as setting the initial access states, this also defines the set of permissions that are known to the permission store.
States can be specified in full by using PermissionAccessState
objects, or alternatively a PermissionAccessStatus string can be
used, in which case dismissCount
will initialize to 0
.
The result of calling buildInitialPermissionStates.
Optional
isA custom function to determine whether two permission descriptors match.
The first descriptor to compare.
The second descriptor to compare.
Whether the descriptors match.
Optional
masksPermission masks to apply when mapping PermissionAccessStatus values to PermissionState values for various permissions.
Internally, this library stores more granular statuses for permissions than what is exposed via the W3C Permissions API. This mapping defines how the internal PermissionAccessStatus values are exposed via the fake Permissions API's PermissionState values.
For example, some browsers support allowing one-time access to a
permission. This usually results in the PermissionState remaining
as "prompt"
even after access has been allowed
or denied. In order to emulate this behavior, the default behavior of this
library is to use a mask that maps both
"ALLOWED"
and
"DENIED"
to
"prompt"
.
If no explicit mappings are provided, the default mapping is:
PermissionAccessStatus | PermissionState |
---|---|
"PROMPT" |
"prompt" |
"GRANTED" |
"granted" |
"BLOCKED" |
"denied" |
"BLOCKED_AUTOMATICALLY" |
"denied" |
"ALLOWED" |
"prompt" |
"DENIED" |
"prompt" |
Parameters for creating a permission store.
See
createPermissionStore to create a permission store.