Edit

Share via


WebView.PermissionRequested Event

Definition

Occurs when an action in a WebView requires that permission be granted.

public event EventHandler<Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlPermissionRequestedEventArgs> PermissionRequested;
member this.PermissionRequested : EventHandler<Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlPermissionRequestedEventArgs> 
Public Event PermissionRequested As EventHandler(Of WebViewControlPermissionRequestedEventArgs) 

Event Type

Implements

Remarks

The types of permission that can be requested are defined in the Windows.Web.UI.WebViewControlPermissionType enumeration.

If you don't handle the PermissionRequested event, the WebView denies permission by default.

When you handle a permission request in WebView, you get a Windows.Web.UI.WebViewControlPermissionRequest object as the value of the Windows.Web.UI.WebViewControlPermissionRequestedEventArgs.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.

Applies to