IWebViewControl.PermissionRequested IWebViewControl.PermissionRequested IWebViewControl.PermissionRequested IWebViewControl.PermissionRequested IWebViewControl.PermissionRequested Event

Definition

Occurs when an action in an IWebViewControl requires that permission be granted.

public : event TypedEventHandler<IWebViewControl, WebViewControlPermissionRequestedEventArgs> PermissionRequested
// Register
event_token PermissionRequested(TypedEventHandler<IWebViewControl, WebViewControlPermissionRequestedEventArgs> const& handler) const;

// Revoke with event_token
void PermissionRequested(event_token const& cookie) const;

// Revoke with event_revoker
PermissionRequested_revoker PermissionRequested(auto_revoke_t, TypedEventHandler<IWebViewControl, WebViewControlPermissionRequestedEventArgs> const& handler) const;
public event TypedEventHandler<IWebViewControl, WebViewControlPermissionRequestedEventArgs> PermissionRequested
Public Event PermissionRequested As TypedEventHandler (Of IWebViewControl, WebViewControlPermissionRequestedEventArgs)
function onPermissionRequested(eventArgs){/* Your code */}


iWebViewControl.addEventListener("permissionrequested", onPermissionRequested);
iWebViewControl.removeEventListener("permissionrequested", onPermissionRequested);

Remarks

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

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

When you handle a permission request in a IWebViewControl, you get a WebViewControlPermissionRequest object as the value of the 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. For example, you might defer the request if you need to prompt the user for consent.

When you defer a WebViewControlPermissionRequest, a new WebViewControlPermissionRequest is created with the same Id and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the GetDeferredPermissionRequestById 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.