Previous topicNext topic
Help > Events >
PermissionRequested

PermissionRequested Event

Raised when content in a OrdoWebView2 requests permission to access some privileged resources.

Syntax

Private Sub object_PermissionRequested(IsUserInitiated As Boolean, State As oWebView2PermissionState, URI As String, PermissionKind As oWebView2PermissionKind)

The PermissionRequested event syntax has these parts:

Element Description
Object The object placeholder represents an OrdoWebView2 control
IsUserInitiated Boolean. True when the permission request was initiated through a user gesture such as clicking an anchor tag with target.
State oWebView2PermissionState. Gets or Sets the status of a permission request. For example, whether the request is granted.
    oWebView2PermissionState
        PERMISSION_STATE_DEFAULT = 0
        PERMISSION_STATE_ALLOW = 1
        PERMISSION_STATE_DENY = 2
URI String. Gets the origin of the web content that requests the permission.
PermissionKind

oWebView2PermissionKind. Gets the kind of the permission that is requested.
    oWebView2PermissionKind
        PERMISSION_KIND_UNKNOWN_PERMISSION = 0
        PERMISSION_KIND_MICROPHONE = 1
        PERMISSION_KIND_CAMERA = 2
        PERMISSION_KIND_GEOLOCATION = 3
        PERMISSION_KIND_NOTIFICATIONS = 4
        PERMISSION_KIND_OTHER_SENSORS = 5
    
    PERMISSION_KIND_CLIPBOARD_READ = 6