setPermissionStatus(_:for:expirationDate:)
Sets the permission status of a URL with a distant future expiration date.
Declaration
func setPermissionStatus(_ status: WKWebExtensionContext.PermissionStatus, for url: URL, expirationDate: Date?)Parameters
- status:
The new permission status to set for the given URL.
- url:
The URL for which to set the status.
- expirationDate:
The expiration date for the new permission status, or
nilfor distant future.
Discussion
The URL is converted into a match pattern and will update grantedPermissionMatchPatterns and deniedPermissionMatchPatterns. Use this method for changing a single URL’s status. Passing a nil expiration date will be treated as a distant future date. Only WKWebExtensionContext.PermissionStatus.deniedExplicitly, WKWebExtensionContext.PermissionStatus.unknown, and WKWebExtensionContext.PermissionStatus.grantedExplicitly states are allowed to be set using this method.