ICoreWebView2_12

Undocumented in source.

Members

Functions

add_StatusBarTextChanged
HRESULT add_StatusBarTextChanged(ICoreWebView2StatusBarTextChangedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the StatusBarTextChanged event. StatusBarTextChanged fires when the WebView is showing a status message, a URL, or an empty string (an indication to hide the status bar). \snippet SettingsComponent.cpp StatusBarTextChanged

get_StatusBarText
HRESULT get_StatusBarText(LPWSTR* value)

The status message text.

remove_StatusBarTextChanged
HRESULT remove_StatusBarTextChanged(EventRegistrationToken token)

Remove an event handler previously added with add_StatusBarTextChanged.

Inherited Members

From ICoreWebView2_11

CallDevToolsProtocolMethodForSession
HRESULT CallDevToolsProtocolMethodForSession(LPCWSTR sessionId, LPCWSTR methodName, LPCWSTR parametersAsJson, ICoreWebView2CallDevToolsProtocolMethodCompletedHandler handler)

Runs an asynchronous DevToolsProtocol method for a specific session of an attached target. There could be multiple DevToolsProtocol targets in a WebView. Besides the top level page, iframes from different origin and web workers are also separate targets. Attaching to these targets allows interaction with them. When the DevToolsProtocol is attached to a target, the connection is identified by a sessionId. To use this API, you must set the flatten parameter to true when calling Target.attachToTarget or Target.setAutoAttach DevToolsProtocol method. Using Target.setAutoAttach is recommended as that would allow you to attach to dedicated worker targets, which are not discoverable via other APIs like Target.getTargets. For more information about targets and sessions, navigate to DevTools Protocol Viewer. For more information about available methods, navigate to DevTools Protocol Viewer

The sessionId parameter is the sessionId for an attached target. nullptr or empty string is treated as the session for the default target for the top page. The methodName parameter is the full name of the method in the {domain}.{method} format. The parametersAsJson parameter is a JSON formatted string containing the parameters for the corresponding method. The Invoke method of the handler is run when the method asynchronously completes. Invoke is run with the return object of the method as a JSON string. This function returns E_INVALIDARG if the methodName is unknown or the parametersAsJson has an error. In the case of such an error, the returnObjectAsJson parameter of the handler will include information about the error.

add_ContextMenuRequested
HRESULT add_ContextMenuRequested(ICoreWebView2ContextMenuRequestedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the ContextMenuRequested event. ContextMenuRequested event is raised when a context menu is requested by the user and the content inside WebView hasn't disabled context menus. The host has the option to create their own context menu with the information provided in the event or can add items to or remove items from WebView context menu. If the host doesn't handle the event, WebView will display the default context menu.

remove_ContextMenuRequested
HRESULT remove_ContextMenuRequested(EventRegistrationToken token)

Remove an event handler previously added with add_ContextMenuRequested.

Meta