WebViewPermissionRequest WebViewPermissionRequest WebViewPermissionRequest WebViewPermissionRequest Class

Definition

Represents a request for permissions in a WebView.

public : sealed class WebViewPermissionRequest : IWebViewPermissionRequestpublic sealed class WebViewPermissionRequest : IWebViewPermissionRequestPublic NotInheritable Class WebViewPermissionRequest Implements IWebViewPermissionRequest// This API is not available in Javascript.
Attributes
Windows 10 requirements
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.
Value
WebViewPermissionType WebViewPermissionType WebViewPermissionType WebViewPermissionType

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.
Value
WebViewPermissionState WebViewPermissionState WebViewPermissionState WebViewPermissionState

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

Allow() Allow() Allow() Allow()

Grants the requested permission.

public : void Allow()public void Allow()Public Function Allow() As void// This API is not available in Javascript.

Remarks

When you allow the requested permission, subsequent calls to Allow, Deny, or Defer the permission request result in an error.

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.

Deny() Deny() Deny() Deny()

Denies the requested permission.

public : void Deny()public void Deny()Public Function Deny() As void// This API is not available in Javascript.

Remarks

When you deny the requested permission, subsequent calls to Allow, Deny, or Defer the permission request result in an error.