ICoreWebView2Frame3.add_PermissionRequested

Add an event handler for the PermissionRequested event. PermissionRequested is raised when content in an iframe any of its descendant iframes requests permission to privileged resources.

This relates to the PermissionRequested event on the CoreWebView2. Both these events will be raised in the case of an iframe requesting permission. The CoreWebView2Frame's event handlers will be invoked before the event handlers on the CoreWebView2. If the Handled property of the PermissionRequestedEventArgs is set to TRUE within the CoreWebView2Frame event handler, then the event will not be raised on the CoreWebView2, and it's event handlers will not be invoked.

In the case of nested iframes, the 'PermissionRequested' event will be raised from the top level iframe.

If a deferral is not taken on the event args, the subsequent scripts are blocked until the event handler returns. If a deferral is taken, the scripts are blocked until the deferral is completed.

\snippet ScenarioIFrameDevicePermission.cpp PermissionRequested0 \snippet ScenarioIFrameDevicePermission.cpp PermissionRequested1

interface ICoreWebView2Frame3
HRESULT
add_PermissionRequested

Meta