Crate webview2_sys[][src]

Expand description

Low Level Bindings for WebView2 SDK.

Structs

A value representing RGBA color (Red, Green, Blue, Alpha) for WebView2. Each component takes a value from 0 to 255, with 0 being no intensity and 255 being the highest intensity.

Represents a reference to a delegate that receives change notifications.

Contains the information packed into the LPARAM sent to a Win32 key event. For more information about WM_KEYDOWN, navigate to [WM_KEYDOWN message][WindowsWin32InputdevWmKeydown].

Enums

Mode for how the Bounds property is interpreted in relation to the RasterizationScale property.

Specifies the image format for the ICoreWebView2::CapturePreview method.

Kind of cookie SameSite status used in the ICoreWebView2Cookie interface. These fields match those as specified in https://developer.mozilla.org/docs/Web/HTTP/Cookies#. Learn more about SameSite cookies here: https://tools.ietf.org/html/draft-west-first-party-cookies-07

Reason why a download was interrupted.

State of the download operation.

Kind of cross origin resource access allowed for host resources during download. Note that other normal access checks like same origin DOM access check and Content Security Policy still apply. The following table illustrates the host resource cross origin access according to access context and COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND.

Specifies the key event type that triggered an AcceleratorKeyPressed event.

Mouse event type used by SendMouseInput to convey the type of mouse event being sent to WebView. The values of this enum align with the matching WM_* window messages.

Mouse event virtual keys associated with a COREWEBVIEW2_MOUSE_EVENT_KIND for SendMouseInput. These values can be combined into a bit flag if more than one virtual key is pressed for the event. The values of this enum align with the matching MK_* mouse keys.

Specifies the reason for moving focus.

Indicates the type of a permission request.

Specifies the response to a permission request.

Pointer event type used by SendPointerInput to convey the type of pointer event being sent to WebView. The values of this enum align with the matching WM_POINTER* window messages.

Specifies the process failure type used in the ICoreWebView2ProcessFailedEventHandler interface. The values in this enum make reference to the process kinds in the Chromium architecture. For more information about what these processes are and what they do, see Browser Architecture - Inside look at modern web browser.

Specifies the process failure reason used in the ICoreWebView2ProcessFailedEventHandler interface.

Specifies the JavaScript dialog type used in the ICoreWebView2ScriptDialogOpeningEventHandler interface.

Indicates the error status values for web navigations.

Specifies the web resource request contexts.

Constants

Traits

WebView2 enables you to host web content using the latest Microsoft Edge browser and web technology.

Event args for the AcceleratorKeyPressed event.

Receives AcceleratorKeyPressed events.

Receives the result of the AddScriptToExecuteOnDocumentCreated method.

Implements the interface to receive BytesReceivedChanged event. Use the ICoreWebView2DownloadOperation.BytesReceived property to get the received bytes count.

Receives CallDevToolsProtocolMethod completion results.

Receives the result of the CapturePreview method. The result is written to the stream provided in the CapturePreview method.

Provides access to the certificate metadata

A collection of client certificate object.

Event args for the ClientCertificateRequested event.

An event handler for the ClientCertificateRequested event.

This interface is an extension of the ICoreWebView2Controller interface to support visual hosting. An object implementing the ICoreWebView2CompositionController interface will also implement ICoreWebView2Controller. Callers are expected to use ICoreWebView2Controller for resizing, visibility, focus, and so on, and then use ICoreWebView2CompositionController to connect to a composition tree and provide input meant for the WebView.

A continuation of the ICoreWebView2CompositionController interface.

This is the ICoreWebView2CompositionControllerInterop interface. Interop interface for the CoreWebView2CompositionController WinRT object to allow WinRT end developers to be able to use the COM interfaces as parameters for some methods.

Receives ContainsFullScreenElementChanged events.

Event args for the ContentLoading event.

Receives ContentLoading events.

The owner of the CoreWebView2 object that provides support for resizing, showing and hiding, focusing, and other functionality related to windowing and composition. The CoreWebView2Controller owns the CoreWebView2, and if all references to the CoreWebView2Controller go away, the WebView is closed.

A continuation of the ICoreWebView2Controller interface.

A continuation of the ICoreWebView2Controller2 interface.

Provides a set of properties that are used to manage an ICoreWebView2Cookie.

A list of cookie objects. See ICoreWebView2Cookie. \snippet ScenarioCookieManagement.cpp GetCookies

Creates, adds or updates, gets, or or view the cookies. The changes would apply to the context of the user profile. That is, other WebViews under the same user profile could be affected.

The caller implements this interface to receive the CoreWebView2Controller created via CreateCoreWebView2CompositionController.

Receives the CoreWebView2Controller created using CreateCoreWebView2Controller.

Receives the WebView2Environment created using CreateCoreWebView2Environment.

The caller implements this interface to receive CursorChanged events. Use the Cursor property to get the new cursor.

Event args for the DOMContentLoaded event.

Receives DOMContentLoaded events.

This interface is used to complete deferrals on event args that support getting deferrals using the GetDeferral method.

Event args for the DevToolsProtocolEventReceived event.

Receives DevToolsProtocolEventReceived events from the WebView.

A Receiver is created for a particular DevTools Protocol event and allows you to subscribe and unsubscribe from that event. Obtained from the WebView object using GetDevToolsProtocolEventReceiver.

Receives DocumentTitleChanged events. Use the DocumentTitle property to get the modified title.

Represents a download operation. Gives access to the download’s metadata and supports a user canceling, pausing, or resuming the download.

Event args for the DownloadStarting event.

Add an event handler for the DownloadStarting event.

Represents the WebView2 Environment. WebViews created from an environment run on the browser process specified with environment parameters and objects created from an environment should be used in the same environment. Using it in different environments are not guaranteed to be compatible and may fail.

A continuation of the ICoreWebView2Environment interface.

A continuation of the ICoreWebView2Environment2 interface.

A continuation of the ICoreWebView2Environment3 interface.

This is the ICoreWebView2EnvironmentInterop interface. Interop interface for the CoreWebView2Environment WinRT object to allow WinRT end developers to be able to use COM interfaces as parameters for some methods.

Options used to create WebView2 Environment. A default implementation is provided in WebView2EnvironmentOptions.h.

Implements the interface to receive EstimatedEndTimeChanged event. Use the ICoreWebView2DownloadOperation.EstimatedEndTime property to get the new estimated end time.

Receives the result of the ExecuteScript method.

Receives GotFocus and LostFocus events.

WebView2Frame provides direct access to the iframes information.

Event args for the FrameCreated events.

Receives FrameCreated event.

Receives FrameDestroyed event.

Provides a set of properties for a frame in the ICoreWebView2.

Collection of FrameInfos (name and source). Used to list the affected frames’ info when a frame-only render process failure occurs in the ICoreWebView2.

Iterator for a collection of FrameInfos. For more info, see ICoreWebView2ProcessFailedEventArgs2 and ICoreWebView2FrameInfoCollection.

Receives FrameNameChanged event.

Receives the result of the GetCookies method. The result is written to the cookie list provided in the GetCookies method call.

Receives HistoryChanged events.

Iterator for a collection of HTTP headers. For more information, navigate to ICoreWebView2HttpRequestHeaders and ICoreWebView2HttpResponseHeaders.

HTTP request headers. Used to inspect the HTTP request on WebResourceRequested event and NavigationStarting event.

HTTP response headers. Used to construct a WebResourceResponse for the WebResourceRequested event.

This is the ICoreWebView2Interop interface. Interop interface for the CoreWebView2 WinRT object to allow WinRT end developers to be able to use COM interfaces as parameters for some methods.

Event args for the MoveFocusRequested event.

Receives MoveFocusRequested events.

Event args for the NavigationCompleted event.

Receives NavigationCompleted events.

Event args for the NavigationStarting event.

Receives NavigationStarting events.

Receives NewBrowserVersionAvailable events.

Event args for the NewWindowRequested event. The event is run when content inside webview requested to a open a new window (through window.open() and so on).

Receives NewWindowRequested events.

Event args for the PermissionRequested event.

Receives PermissionRequested events.

This mostly represents a combined win32 POINTER_INFO/POINTER_TOUCH_INFO/POINTER_PEN_INFO object. It takes fields from all three and excludes some win32 specific data types like HWND and HANDLE. Note, sourceDevice is taken out but we expect the PointerDeviceRect and DisplayRect to cover the existing use cases of sourceDevice. Another big difference is that any of the point or rect locations are expected to be in WebView physical coordinates. That is, coordinates relative to the WebView and no DPI scaling applied.

Event args for the ProcessFailed event.

A continuation of the ICoreWebView2ProcessFailedEventArgs interface.

Receives ProcessFailed events.

Receives RasterizationScaleChanged events. Use the RasterizationScale property to get the modified scale.

Event args for the ScriptDialogOpening event.

Receives ScriptDialogOpening events.

Defines properties that enable, disable, or modify WebView features. Setting changes made after NavigationStarting event does not apply until the next top-level navigation.

A continuation of the ICoreWebView2Settings interface that manages the user agent.

A continuation of the ICoreWebView2Settings interface that manages whether browser accelerator keys are enabled.

A continuation of the ICoreWebView2Settings interface to manage autofill.

A continuation of the ICoreWebView2Settings interface to manage pinch zoom.

Event args for the SourceChanged event.

Receives SourceChanged events.

Implements the interface to receive StateChanged event. Use the ICoreWebView2DownloadOperation.State property to get the current state, which can be in progress, interrupted, or completed. Use the ICoreWebView2DownloadOperation.InterruptReason property to get the interrupt reason if the download is interrupted.

A collection of strings.

The caller implements this interface to receive the TrySuspend result.

Event args for the WebMessageReceived event.

Receives WebMessageReceived events.

An HTTP request used with the WebResourceRequested event.

Event args for the WebResourceRequested event.

Runs when a URL request (through network, file, and so on) is made in the webview for a Web resource matching resource context filter and URL specified in AddWebResourceRequestedFilter. The host views and modifies the request or provide a response in a similar pattern to HTTP, in which case the request immediately completed. This may not contain any request headers that are added by the network stack, such as an Authorization header.

An HTTP response used with the WebResourceRequested event.

Event args for the WebResourceResponseReceived event.

Receives WebResourceResponseReceived events.

View of the HTTP representation for a web resource response. The properties of this object are not mutable. This response view is used with the WebResourceResponseReceived event.

Receives the result of the ICoreWebView2WebResourceResponseView::GetContent method.

Receives WindowCloseRequested events.

The window features for a WebView popup window. The fields match the windowFeatures passed to window.open as specified in [Window features][MdnDocsWebApiWindowOpenWindowFeatures] on MDN. There is no requirement for you to respect the values. If your app does not have corresponding UI features (for example, no toolbar) or if all instance of WebView are opened in tabs and do not have distinct size or positions, then your app does not respect the values. You may want to respect values, but perhaps only some apply to the UI of you app. Accordingly, you may respect all, some, or none of the properties as appropriate for your app. For all numeric properties, if the value that is passed to window.open is outside the range of an unsigned 32bit int, the resulting value is the absolute value of the maximum for unsigned 32bit integer. If you are not able to parse the value an integer, it is considered 0. If the value is a floating point value, it is rounded down to an integer.

Implements the interface to receive ZoomFactorChanged events. Use the ICoreWebView2Controller.ZoomFactor property to get the modified zoom factor.

A continuation of the ICoreWebView2 interface.

A continuation of the ICoreWebView2_2 interface.

A continuation of the ICoreWebView2_3 interface to support FrameCreated and DownloadStarting events.

A continuation of the ICoreWebView2_4 interface to support ClientCertificateRequested event.

Functions

Type Definitions