ICoreWebView2Frame3

Undocumented in source.

Members

Functions

add_PermissionRequested
HRESULT add_PermissionRequested(ICoreWebView2FramePermissionRequestedEventHandler handler, EventRegistrationToken* token)

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.

remove_PermissionRequested
HRESULT remove_PermissionRequested(EventRegistrationToken token)

Remove an event handler previously added with add_PermissionRequested

Inherited Members

From ICoreWebView2Frame2

add_NavigationStarting
HRESULT add_NavigationStarting(ICoreWebView2FrameNavigationStartingEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the NavigationStarting event. A frame navigation will raise a NavigationStarting event and a CoreWebView2.FrameNavigationStarting event. All of the FrameNavigationStarting event handlers for the current frame will be run before the NavigationStarting event handlers. All of the event handlers share a common NavigationStartingEventArgs object. Whichever event handler is last to change the NavigationStartingEventArgs.Cancel property will decide if the frame navigation will be cancelled. Redirects raise this event as well, and the navigation id is the same as the original one.

remove_NavigationStarting
HRESULT remove_NavigationStarting(EventRegistrationToken token)

Remove an event handler previously added with add_NavigationStarting.

add_ContentLoading
HRESULT add_ContentLoading(ICoreWebView2FrameContentLoadingEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the ContentLoading event. ContentLoading triggers before any content is loaded, including scripts added with AddScriptToExecuteOnDocumentCreated. ContentLoading does not trigger if a same page navigation occurs (such as through fragment navigations or history.pushState navigations). This operation follows the NavigationStarting and precedes NavigationCompleted events.

remove_ContentLoading
HRESULT remove_ContentLoading(EventRegistrationToken token)

Remove an event handler previously added with add_ContentLoading.

add_NavigationCompleted
HRESULT add_NavigationCompleted(ICoreWebView2FrameNavigationCompletedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the NavigationCompleted event. NavigationCompleted runs when the CoreWebView2Frame has completely loaded (concurrently when body.onload runs) or loading stopped with error.

remove_NavigationCompleted
HRESULT remove_NavigationCompleted(EventRegistrationToken token)

Remove an event handler previously added with add_NavigationCompleted.

add_DOMContentLoaded
HRESULT add_DOMContentLoaded(ICoreWebView2FrameDOMContentLoadedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the DOMContentLoaded event. DOMContentLoaded is raised when the iframe html document has been parsed. This aligns with the document's DOMContentLoaded event in html.

remove_DOMContentLoaded
HRESULT remove_DOMContentLoaded(EventRegistrationToken token)

Remove an event handler previously added with add_DOMContentLoaded.

ExecuteScript
HRESULT ExecuteScript(LPCWSTR javaScript, ICoreWebView2ExecuteScriptCompletedHandler handler)

Run JavaScript code from the javascript parameter in the current frame. The result of evaluating the provided JavaScript is passed to the completion handler. The result value is a JSON encoded string. If the result is undefined, contains a reference cycle, or otherwise is not able to be encoded into JSON, then the result is considered to be null, which is encoded in JSON as the string "null".

PostWebMessageAsJson
HRESULT PostWebMessageAsJson(LPCWSTR webMessageAsJson)

Posts the specified webMessage to the frame. The frame receives the message by subscribing to the message event of the window.chrome.webview of the frame document.

PostWebMessageAsString
HRESULT PostWebMessageAsString(LPCWSTR webMessageAsString)

Posts a message that is a simple string rather than a JSON string representation of a JavaScript object. This behaves in exactly the same manner as PostWebMessageAsJson, but the data property of the event args of the window.chrome.webview message is a string with the same value as webMessageAsString. Use this instead of PostWebMessageAsJson if you want to communicate using simple strings rather than JSON objects.

add_WebMessageReceived
HRESULT add_WebMessageReceived(ICoreWebView2FrameWebMessageReceivedEventHandler handler, EventRegistrationToken* token)

Add an event handler for the WebMessageReceived event. WebMessageReceived runs when the ICoreWebView2Settings::IsWebMessageEnabled setting is set and the frame document runs window.chrome.webview.postMessage. The postMessage function is void postMessage(object) where object is any object supported by JSON conversion.

remove_WebMessageReceived
HRESULT remove_WebMessageReceived(EventRegistrationToken token)

Remove an event handler previously added with add_WebMessageReceived.

Meta