Skip to content

OnPermissionRequested - cWebView2Browser

Sent when the page requires a specific permission

Type: Event

Parameters

Parameter Type Description
sUrl String URL of the page requesting the permission
eKind OLECOREWEBVIEW2_PERMISSION_KIND Kind of permission requested
isUserInitiated Boolean True if the user initiated the request
ByRef eState OLECOREWEBVIEW2_PERMISSION_STATE Set to override the request result

Syntax

Procedure OnPermissionRequested String sUrl OLECOREWEBVIEW2_PERMISSION_KIND eKind Boolean isUserInitiated ByRef OLECOREWEBVIEW2_PERMISSION_STATE 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:

Constant Meaning
OLECOREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION Unknown
OLECOREWEBVIEW2_PERMISSION_KIND_MICROPHONE The page wants to access the device its microphone.
OLECOREWEBVIEW2_PERMISSION_KIND_CAMERA The page wants to access the device its camera.
OLECOREWEBVIEW2_PERMISSION_KIND_GEOLOCATION The page wants to access the device its current location.
OLECOREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS The page wants to be able to send notifications.
OLECOREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS
OLECOREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ The page wants access to the clipboard.