WebViewPermissionRequest
WebViewPermissionRequest
WebViewPermissionRequest
WebViewPermissionRequest
Class
Definition
public : sealed class WebViewPermissionRequest : IWebViewPermissionRequestpublic sealed class WebViewPermissionRequest : IWebViewPermissionRequestPublic NotInheritable Class WebViewPermissionRequest Implements IWebViewPermissionRequest// This API is not available in Javascript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
For more info, see the WebView.PermissionRequested event.
When you handle a permission request in a WebView, you get a WebViewPermissionRequest object as the value of the WebViewPermissionRequestedEventArgs.PermissionRequest property. You can call Allow to grant the request, Deny to deny the request, or Defer to defer the request until a later time. For example, you might defer the request if you need to prompt the user for consent.
Properties
Id Id Id Id
Gets the identifier for the permission request.
public : unsigned int Id { get; }public uint Id { get; }Public ReadOnly Property Id As uint// This API is not available in Javascript.
- Value
- unsigned int uint uint uint
The identifier for the permission request.
Remarks
If you defer a permission request, save the Id to use later to retrieve the deferred request.
When a WebViewPermissionRequest is deferred, a WebViewDeferredPermissionRequest is created with the same Id and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the DeferredPermissionRequestById method and pass the Id of the deferred request.
PermissionType PermissionType PermissionType PermissionType
Gets a value that indicates the type of permission that's requested.
public : WebViewPermissionType PermissionType { get; }public WebViewPermissionType PermissionType { get; }Public ReadOnly Property PermissionType As WebViewPermissionType// This API is not available in Javascript.
An enumeration value that indicates the type of permission requested.
State State State State
Gets the current state of the permission request.
public : WebViewPermissionState State { get; }public WebViewPermissionState State { get; }Public ReadOnly Property State As WebViewPermissionState// This API is not available in Javascript.
An enumeration value that indicates the current state of the permission request. The default is Unknown.
Remarks
The default State value is Unknown. Calling the Allow, Deny, or Defer method sets the State property to the corresponding WebViewPermissionState.
Uri Uri Uri Uri
Gets the Uniform Resource Identifier (URI) of the content where the permission request originated.
public : Uri Uri { get; }public Uri Uri { get; }Public ReadOnly Property Uri As Uri// This API is not available in Javascript.
- Value
- Uri Uri Uri Uri
The Uniform Resource Identifier (URI) of the content where the permission request originated.
Methods
Defer() Defer() Defer() Defer()
Defers the permission request to be allowed or denied at a later time.
public : void Defer()public void Defer()Public Function Defer() As void// This API is not available in Javascript.
Remarks
When you defer a WebViewPermissionRequest, a new WebViewDeferredPermissionRequest is created with the same Id and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the DeferredPermissionRequestById method and pass the Id of the deferred request. After you retrieve the request, you can call the Allow method to grant the request, or call the Deny method to deny the request.