OnPermissionRequested - cWebView2Browser

Sent when the page requires a specific permission

Type: Event

Parameters: String sUrl OLECOREWEBVIEW2_PERMISSION_KIND eKind Boolean isUserInitiated OLECOREWEBVIEW2_PERMISSION_STATE ByRef eState

ParameterDescription
sUrlURL of the page requesting the permission
eKindKind of permission requested
isUserInitiatedTrue if the user initiated the request
eState (ByRef)Set to override the request result


Syntax
Procedure OnPermissionRequested String sUrl OLECOREWEBVIEW2_PERMISSION_KIND eKind Boolean isUserInitiated OLECOREWEBVIEW2_PERMISSION_STATE ByRef eState

Description

This message is sent when the page requires a specific permission.

Implement this event to override the default browser behavior and grant or deny the requested permission.

This can be done by changing eState to OLECOREWEBVIEW2_PERMISSION_STATE_ALLOW or OLECOREWEBVIEW2_PERMISSION_STATE_DENY.

Requested permission kinds can be:

ConstantMeaning
OLECOREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSIONUnknown
OLECOREWEBVIEW2_PERMISSION_KIND_MICROPHONEThe page wants to access the device its microphone.
OLECOREWEBVIEW2_PERMISSION_KIND_CAMERAThe page wants to access the device its camera.
OLECOREWEBVIEW2_PERMISSION_KIND_GEOLOCATIONThe page wants to access the device its current location.
OLECOREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONSThe page wants to be able to send notifications.
OLECOREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS
OLECOREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READThe page wants access to the clipboard.