ICoreWebView2_11

Undocumented in source.

Members

Functions

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.

Inherited Members

From ICoreWebView2_10

add_BasicAuthenticationRequested
HRESULT add_BasicAuthenticationRequested(ICoreWebView2BasicAuthenticationRequestedEventHandler eventHandler, EventRegistrationToken* token)

Add an event handler for the BasicAuthenticationRequested event. BasicAuthenticationRequested event is raised when WebView encounters a Basic HTTP Authentication request as described in https://developer.mozilla.org/docs/Web/HTTP/Authentication, a Digest HTTP Authentication request as described in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#digest, an NTLM authentication or a Proxy Authentication request.

remove_BasicAuthenticationRequested
HRESULT remove_BasicAuthenticationRequested(EventRegistrationToken token)

Remove an event handler previously added with add_BasicAuthenticationRequested.

Meta