Globals
Note
This reference is no longer being maintained. For the latest API reference, see WebView2 API Reference.
Summary
Members | Descriptions |
---|---|
COREWEBVIEW2_BOUNDS_MODE | Mode for how the Bounds property is interpreted in relation to the RasterizationScale property. |
COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND | Specifies the browser process exit type used in the ICoreWebView2BrowserProcessExitedEventArgs interface. |
COREWEBVIEW2_BROWSING_DATA_KINDS | Specifies the datatype for the ICoreWebView2Profile2::ClearBrowsingData method. |
COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT | Specifies the image format for the ICoreWebView2::CapturePreview method. |
COREWEBVIEW2_CHANNEL_SEARCH_KIND | The channel search kind determines the order that release channels are searched for during environment creation. |
COREWEBVIEW2_CLIENT_CERTIFICATE_KIND | Specifies the client certificate kind. |
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND | Specifies the menu item kind for the ICoreWebView2ContextMenuItem::get_Kind method. |
COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND | Indicates the kind of context for which the context menu was created for the ICoreWebView2ContextMenuTarget::get_Kind method. |
COREWEBVIEW2_COOKIE_SAME_SITE_KIND | Kind of cookie SameSite status used in the ICoreWebView2Cookie interface. |
COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT | The default download dialog can be aligned to any of the WebView corners by setting the DefaultDownloadDialogCornerAlignment property. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON | Reason why a download was interrupted. |
COREWEBVIEW2_DOWNLOAD_STATE | State of the download operation. |
COREWEBVIEW2_FAVICON_IMAGE_FORMAT | Specifies the image format to use for favicon. |
COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND | Kind of CoreWebView2FileSystemHandle as described in FileSystemHandle.kind |
COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION | Allowed permissions of a CoreWebView2FileSystemHandle as described in FileSystemHandle.requestPermission() |
COREWEBVIEW2_FRAME_KIND | Indicates the frame type used in the ICoreWebView2FrameInfo interface. |
COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND | Kind of cross origin resource access allowed for host resources during download. |
COREWEBVIEW2_KEY_EVENT_KIND | Specifies the key event type that triggered an AcceleratorKeyPressed event. |
COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL | Specifies memory usage target level of WebView. |
COREWEBVIEW2_MOUSE_EVENT_KIND | Mouse event type used by SendMouseInput to convey the type of mouse event being sent to WebView. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS | Mouse event virtual keys associated with a COREWEBVIEW2_MOUSE_EVENT_KIND for SendMouseInput. |
COREWEBVIEW2_MOVE_FOCUS_REASON | Specifies the reason for moving focus. |
COREWEBVIEW2_NAVIGATION_KIND | Specifies the navigation kind of each navigation. |
COREWEBVIEW2_NON_CLIENT_REGION_KIND | This enum contains values representing possible regions a given point lies within. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS | Specifies the PDF toolbar item types used for the ICoreWebView2Settings::put_HiddenPdfToolbarItems method. |
COREWEBVIEW2_PERMISSION_KIND | Indicates the type of a permission request. |
COREWEBVIEW2_PERMISSION_STATE | Specifies the response to a permission request. |
COREWEBVIEW2_POINTER_EVENT_KIND | Pointer event type used by SendPointerInput to convey the type of pointer event being sent to WebView. |
COREWEBVIEW2_PREFERRED_COLOR_SCHEME | An enum to represent the options for WebView2 color scheme: auto, light, or dark. |
COREWEBVIEW2_PRINT_COLLATION | Specifies the collation for a print. |
COREWEBVIEW2_PRINT_COLOR_MODE | Specifies the color mode for a print. |
COREWEBVIEW2_PRINT_DIALOG_KIND | Specifies the print dialog kind. |
COREWEBVIEW2_PRINT_DUPLEX | Specifies the duplex option for a print. |
COREWEBVIEW2_PRINT_MEDIA_SIZE | Specifies the media size for a print. |
COREWEBVIEW2_PRINT_ORIENTATION | The orientation for printing, used by the Orientation property on ICoreWebView2PrintSettings. |
COREWEBVIEW2_PRINT_STATUS | Indicates the status for printing. |
COREWEBVIEW2_PROCESS_FAILED_KIND | Specifies the process failure type used in the ICoreWebView2ProcessFailedEventArgs interface. |
COREWEBVIEW2_PROCESS_FAILED_REASON | Specifies the process failure reason used in the ICoreWebView2ProcessFailedEventArgs interface. |
COREWEBVIEW2_PROCESS_KIND | Indicates the process type used in the ICoreWebView2ProcessInfo interface. |
COREWEBVIEW2_RELEASE_CHANNELS | The WebView2 release channels. |
COREWEBVIEW2_SCRIPT_DIALOG_KIND | Specifies the JavaScript dialog type used in the ICoreWebView2ScriptDialogOpeningEventHandler interface. |
COREWEBVIEW2_SCROLLBAR_STYLE | Set ScrollBar style on ICoreWebView2EnvironmentOptions during environment creation. |
COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION | Specifies the action type when server certificate error is detected to be used in the ICoreWebView2ServerCertificateErrorDetectedEventArgs interface. |
COREWEBVIEW2_SHARED_BUFFER_ACCESS | Specifies the desired access from script to CoreWebView2SharedBuffer . |
COREWEBVIEW2_TRACKING_PREVENTION_LEVEL | Tracking prevention levels. |
COREWEBVIEW2_WEB_ERROR_STATUS | Indicates the error status values for web navigations. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT | Specifies the web resource request contexts. |
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS | Specifies the source of WebResourceRequested event. |
COREWEBVIEW2_COLOR | A value representing RGBA color (Red, Green, Blue, Alpha) for WebView2. |
CompareBrowserVersions | This method is for anyone want to compare version correctly to determine which version is newer, older or same. |
CreateCoreWebView2Environment | Creates an evergreen WebView2 Environment using the installed WebView2 Runtime version. |
CreateCoreWebView2EnvironmentWithOptions | DLL export to create a WebView2 environment with a custom version of WebView2 Runtime, user data folder, and with or without additional options. |
CreateWebViewEnvironmentWithOptionsInternal | This is a DLL export out of EmbeddedBrowserWebView.dll which can be found in the installation folder of the WebView2 Runtime you wish to use. |
GetAvailableCoreWebView2BrowserVersionString | Get the browser version info including channel name if it is not the WebView2 Runtime. |
GetAvailableCoreWebView2BrowserVersionStringWithOptions | This function will tell you the browser version info of the release channel used when creating an environment with the same options. |
Members
COREWEBVIEW2_BOUNDS_MODE
Values | Descriptions |
---|---|
COREWEBVIEW2_BOUNDS_MODE_USE_RAW_PIXELS | Bounds property represents raw pixels. Physical size of Webview is not impacted by RasterizationScale. |
COREWEBVIEW2_BOUNDS_MODE_USE_RASTERIZATION_SCALE | Bounds property represents logical pixels and the RasterizationScale property is used to get the physical size of the WebView. |
Mode for how the Bounds property is interpreted in relation to the RasterizationScale property.
COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND_NORMAL | Indicates that the browser process ended normally. |
COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND_FAILED | Indicates that the browser process ended unexpectedly. |
Specifies the browser process exit type used in the ICoreWebView2BrowserProcessExitedEventArgs interface.
COREWEBVIEW2_BROWSING_DATA_KINDS
Values | Descriptions |
---|---|
COREWEBVIEW2_BROWSING_DATA_KINDS_FILE_SYSTEMS | Specifies file systems data. |
COREWEBVIEW2_BROWSING_DATA_KINDS_INDEXED_DB | Specifies data stored by the IndexedDB DOM feature. |
COREWEBVIEW2_BROWSING_DATA_KINDS_LOCAL_STORAGE | Specifies data stored by the localStorage DOM API. |
COREWEBVIEW2_BROWSING_DATA_KINDS_WEB_SQL | Specifies data stored by the Web SQL database DOM API. |
COREWEBVIEW2_BROWSING_DATA_KINDS_CACHE_STORAGE | Specifies data stored by the CacheStorage DOM API. |
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_DOM_STORAGE | Specifies DOM storage data, now and future. |
COREWEBVIEW2_BROWSING_DATA_KINDS_COOKIES | Specifies HTTP cookies data. |
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_SITE | Specifies all site data, now and future. |
COREWEBVIEW2_BROWSING_DATA_KINDS_DISK_CACHE | Specifies disk cache. |
COREWEBVIEW2_BROWSING_DATA_KINDS_DOWNLOAD_HISTORY | Specifies download history data. |
COREWEBVIEW2_BROWSING_DATA_KINDS_GENERAL_AUTOFILL | Specifies general autofill form data. |
COREWEBVIEW2_BROWSING_DATA_KINDS_PASSWORD_AUTOSAVE | Specifies password autosave data. |
COREWEBVIEW2_BROWSING_DATA_KINDS_BROWSING_HISTORY | Specifies browsing history data. |
COREWEBVIEW2_BROWSING_DATA_KINDS_SETTINGS | Specifies settings data. |
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_PROFILE | Specifies profile data that should be wiped to make it look like a new profile. |
COREWEBVIEW2_BROWSING_DATA_KINDS_SERVICE_WORKERS | Specifies service workers registered for an origin, and clear will result in termination and deregistration of them. |
Specifies the datatype for the ICoreWebView2Profile2::ClearBrowsingData method.
COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT
Values | Descriptions |
---|---|
COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_PNG | Indicates that the PNG image format is used. |
COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_JPEG | Indicates the JPEG image format is used. |
Specifies the image format for the ICoreWebView2::CapturePreview method.
COREWEBVIEW2_CHANNEL_SEARCH_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_CHANNEL_SEARCH_KIND_MOST_STABLE | Search for a release channel from most to least stable: WebView2 Runtime -> Beta -> Dev -> Canary. |
COREWEBVIEW2_CHANNEL_SEARCH_KIND_LEAST_STABLE | Search for a release channel from least to most stable: Canary -> Dev -> Beta -> WebView2 Runtime. |
The channel search kind determines the order that release channels are searched for during environment creation.
The default behavior is to search for and use the most stable channel found on the device. The order from most to least stable is: WebView2 Runtime -> Beta -> Dev -> Canary. Switch the order to prefer the least stable channel in order to perform pre-release testing. See COREWEBVIEW2_RELEASE_CHANNELS
for descriptions of channels.
COREWEBVIEW2_CLIENT_CERTIFICATE_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_SMART_CARD | Specifies smart card certificate. |
COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_PIN | Specifies PIN certificate. |
COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_OTHER | Specifies other certificate. |
Specifies the client certificate kind.
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_COMMAND | Specifies a command menu item kind. |
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_CHECK_BOX | Specifies a check box menu item kind. |
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_RADIO | Specifies a radio button menu item kind. |
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SEPARATOR | Specifies a separator menu item kind. |
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SUBMENU | Specifies a submenu menu item kind. |
Specifies the menu item kind for the ICoreWebView2ContextMenuItem::get_Kind method.
COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_PAGE | Indicates that the context menu was created for the page without any additional content. |
COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_IMAGE | Indicates that the context menu was created for an image element. |
COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_SELECTED_TEXT | Indicates that the context menu was created for selected text. |
COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_AUDIO | Indicates that the context menu was created for an audio element. |
COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_VIDEO | Indicates that the context menu was created for a video element. |
Indicates the kind of context for which the context menu was created for the ICoreWebView2ContextMenuTarget::get_Kind method.
This enum will always represent the active element that caused the context menu request. If there is a selection with multiple images, audio and text, for example, the element that the end user right clicks on within this selection will be the option represented by this enum.
COREWEBVIEW2_COOKIE_SAME_SITE_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_COOKIE_SAME_SITE_KIND_NONE | None SameSite type. No restrictions on cross-site requests. |
COREWEBVIEW2_COOKIE_SAME_SITE_KIND_LAX | Lax SameSite type. The cookie will be sent with "same-site" requests, and with "cross-site" top level navigation. |
COREWEBVIEW2_COOKIE_SAME_SITE_KIND_STRICT | Strict SameSite type. The cookie will only be sent along with "same-site" requests. |
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
COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT
Values | Descriptions |
---|---|
COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_TOP_LEFT | Top-left corner of the WebView. |
COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_TOP_RIGHT | Top-right corner of the WebView. |
COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_BOTTOM_LEFT | Bottom-left corner of the WebView. |
COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_BOTTOM_RIGHT | Bottom-right corner of the WebView. |
The default download dialog can be aligned to any of the WebView corners by setting the DefaultDownloadDialogCornerAlignment
property.
The default position is top-right corner.
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON
Values | Descriptions |
---|---|
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NONE | |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED | Generic file error. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED | Access denied due to security restrictions. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE | Disk full. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG | Result file path with file name is too long. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE | File is too large for file system. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_MALICIOUS | Microsoft Defender Smartscreen detected a virus in the file. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR | File was in use, too many files opened, or out of memory. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED_BY_POLICY | File blocked by local policy. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED | Security check failed unexpectedly. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT | Seeking past the end of a file in opening a file, as part of resuming an interrupted download. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH | Partial file did not match the expected hash and was deleted. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED | Generic network error. User can retry the download manually. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT | Network operation timed out. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED | Network connection lost. User can retry the download manually. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN | Server has gone down. User can retry the download manually. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST | Network request invalid because original or redirected URI is invalid, has an unsupported scheme, or is disallowed by network policy. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED | Generic server error. User can retry the download manually. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE | Server does not support range requests. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT | Server does not have the requested data. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED | Server did not authorize access to resource. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CERTIFICATE_PROBLEM | Server certificate problem. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN | Server access forbidden. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_UNEXPECTED_RESPONSE | Unexpected server response. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH | Server sent fewer bytes than the Content-Length header. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT | Unexpected cross-origin redirect. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED | User canceled the download. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN | User shut down the WebView. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_PAUSED | User paused the download. |
COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_DOWNLOAD_PROCESS_CRASHED | WebView crashed. |
Reason why a download was interrupted.
COREWEBVIEW2_DOWNLOAD_STATE
Values | Descriptions |
---|---|
COREWEBVIEW2_DOWNLOAD_STATE_IN_PROGRESS | The download is in progress. |
COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED | The connection with the file host was broken. |
COREWEBVIEW2_DOWNLOAD_STATE_COMPLETED | The download completed successfully. |
State of the download operation.
COREWEBVIEW2_FAVICON_IMAGE_FORMAT
Values | Descriptions |
---|---|
COREWEBVIEW2_FAVICON_IMAGE_FORMAT_PNG | Indicates that the PNG image format is used. |
COREWEBVIEW2_FAVICON_IMAGE_FORMAT_JPEG | Indicates the JPEG image format is used. |
Specifies the image format to use for favicon.
COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND_FILE | FileSystemHandle is for a file (i.e. |
COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND_DIRECTORY | FileSystemHandle is for a directory (i.e. |
Kind of CoreWebView2FileSystemHandle as described in FileSystemHandle.kind
COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION
Values | Descriptions |
---|---|
COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION_READ_ONLY | Read-only permission for FileSystemHandle. |
COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION_READ_WRITE | Read and write permissions for FileSystemHandle. |
Allowed permissions of a CoreWebView2FileSystemHandle as described in FileSystemHandle.requestPermission()
COREWEBVIEW2_FRAME_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_FRAME_KIND_UNKNOWN | Indicates that the frame is an unknown type frame. |
COREWEBVIEW2_FRAME_KIND_MAIN_FRAME | Indicates that the frame is a primary main frame(webview). |
COREWEBVIEW2_FRAME_KIND_IFRAME | Indicates that the frame is an iframe. |
COREWEBVIEW2_FRAME_KIND_EMBED | Indicates that the frame is an embed element. |
COREWEBVIEW2_FRAME_KIND_OBJECT | Indicates that the frame is an object element. |
Indicates the frame type used in the ICoreWebView2FrameInfo interface.
COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY | All cross origin resource access is denied, including normal sub resource access as src of a script or image element. |
COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_ALLOW | All cross origin resource access is allowed, including accesses that are subject to Cross-Origin Resource Sharing(CORS) check. |
COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY_CORS | Cross origin resource access is allowed for normal sub resource access like as src of a script or image element, while any access that subjects to CORS check will be denied. |
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
.
Cross Origin Access Context | DENY | ALLOW | DENY_CORS |
---|---|---|---|
From DOM like src of img, script or iframe element | Deny | Allow | Allow |
From Script like Fetch or XMLHttpRequest | Deny | Allow | Deny |
COREWEBVIEW2_KEY_EVENT_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_KEY_EVENT_KIND_KEY_DOWN | Specifies that the key event type corresponds to window message WM_KEYDOWN . |
COREWEBVIEW2_KEY_EVENT_KIND_KEY_UP | Specifies that the key event type corresponds to window message WM_KEYUP . |
COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_DOWN | Specifies that the key event type corresponds to window message WM_SYSKEYDOWN . |
COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_UP | Specifies that the key event type corresponds to window message WM_SYSKEYUP . |
Specifies the key event type that triggered an AcceleratorKeyPressed
event.
COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL
Values | Descriptions |
---|---|
COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL | Specifies normal memory usage target level. |
COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW | Specifies low memory usage target level. |
Specifies memory usage target level of WebView.
COREWEBVIEW2_MOUSE_EVENT_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL | Mouse horizontal wheel scroll event, WM_MOUSEHWHEEL. |
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOUBLE_CLICK | Left button double click mouse event, WM_LBUTTONDBLCLK. |
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOWN | Left button down mouse event, WM_LBUTTONDOWN. |
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_UP | Left button up mouse event, WM_LBUTTONUP. |
COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE | Mouse leave event, WM_MOUSELEAVE. |
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOUBLE_CLICK | Middle button double click mouse event, WM_MBUTTONDBLCLK. |
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOWN | Middle button down mouse event, WM_MBUTTONDOWN. |
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_UP | Middle button up mouse event, WM_MBUTTONUP. |
COREWEBVIEW2_MOUSE_EVENT_KIND_MOVE | Mouse move event, WM_MOUSEMOVE. |
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOUBLE_CLICK | Right button double click mouse event, WM_RBUTTONDBLCLK. |
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOWN | Right button down mouse event, WM_RBUTTONDOWN. |
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_UP | Right button up mouse event, WM_RBUTTONUP. |
COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL | Mouse wheel scroll event, WM_MOUSEWHEEL. |
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOUBLE_CLICK | First or second X button double click mouse event, WM_XBUTTONDBLCLK. |
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOWN | First or second X button down mouse event, WM_XBUTTONDOWN. |
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_UP | First or second X button up mouse event, WM_XBUTTONUP. |
COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_DOWN | Mouse Right Button Down event over a nonclient area, WM_NCRBUTTONDOWN. |
COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_UP | Mouse Right Button up event over a nonclient area, WM_NCRBUTTONUP. |
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.
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS
Values | Descriptions |
---|---|
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_NONE | No additional keys pressed. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_LEFT_BUTTON | Left mouse button is down, MK_LBUTTON. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_RIGHT_BUTTON | Right mouse button is down, MK_RBUTTON. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_SHIFT | SHIFT key is down, MK_SHIFT. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_CONTROL | CTRL key is down, MK_CONTROL. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_MIDDLE_BUTTON | Middle mouse button is down, MK_MBUTTON. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON1 | First X button is down, MK_XBUTTON1. |
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON2 | Second X button is down, MK_XBUTTON2. |
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.
COREWEBVIEW2_MOVE_FOCUS_REASON
Values | Descriptions |
---|---|
COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC | Specifies that the code is setting focus into WebView. |
COREWEBVIEW2_MOVE_FOCUS_REASON_NEXT | Specifies that the focus is moving due to Tab traversal forward. |
COREWEBVIEW2_MOVE_FOCUS_REASON_PREVIOUS | Specifies that the focus is moving due to Tab traversal backward. |
Specifies the reason for moving focus.
COREWEBVIEW2_NAVIGATION_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_NAVIGATION_KIND_RELOAD | A navigation caused by CoreWebView2.Reload() , location.reload() , the end user using F5 or other UX, or other reload mechanisms to reload the current document without modifying the navigation history. |
COREWEBVIEW2_NAVIGATION_KIND_BACK_OR_FORWARD | A navigation back or forward to a different entry in the session navigation history, like via CoreWebView2.Back() , location.back() , the end user pressing Alt+Left or other UX, or other mechanisms to navigate back or forward in the current session navigation history. |
COREWEBVIEW2_NAVIGATION_KIND_NEW_DOCUMENT | A navigation to another document, which can be caused by CoreWebView2.Navigate() , window.location.href = ... , or other WebView2 or DOM APIs that navigate to a new URI. |
Specifies the navigation kind of each navigation.
COREWEBVIEW2_NON_CLIENT_REGION_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_NON_CLIENT_REGION_KIND_NOWHERE | A hit test region out of bounds of the WebView2. |
COREWEBVIEW2_NON_CLIENT_REGION_KIND_CLIENT | A hit test region in the WebView2 which does not have the CSS style -webkit-app-region: drag set. |
COREWEBVIEW2_NON_CLIENT_REGION_KIND_CAPTION | A hit test region in the WebView2 which has the CSS style -webkit-app-region: drag set. |
This enum contains values representing possible regions a given point lies within.
COREWEBVIEW2_PDF_TOOLBAR_ITEMS
Values | Descriptions |
---|---|
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE | No item. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE | The save button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT | The print button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE_AS | The save as button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_IN | The zoom in button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_OUT | The zoom out button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ROTATE | The rotate button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FIT_PAGE | The fit page button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_LAYOUT | The page layout button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_BOOKMARKS | The bookmarks button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_SELECTOR | The page select button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SEARCH | The search button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FULL_SCREEN | The full screen button. |
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_MORE_SETTINGS | The more settings button. |
Specifies the PDF toolbar item types used for the ICoreWebView2Settings::put_HiddenPdfToolbarItems
method.
COREWEBVIEW2_PERMISSION_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION | Indicates an unknown permission. |
COREWEBVIEW2_PERMISSION_KIND_MICROPHONE | Indicates permission to capture audio. |
COREWEBVIEW2_PERMISSION_KIND_CAMERA | Indicates permission to capture video. |
COREWEBVIEW2_PERMISSION_KIND_GEOLOCATION | Indicates permission to access geolocation. |
COREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS | Indicates permission to send web notifications. |
COREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS | Indicates permission to access generic sensor. |
COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ | Indicates permission to read the system clipboard without a user gesture. |
COREWEBVIEW2_PERMISSION_KIND_MULTIPLE_AUTOMATIC_DOWNLOADS | Indicates permission to automatically download multiple files. |
COREWEBVIEW2_PERMISSION_KIND_FILE_READ_WRITE | Indicates permission to read and write to files or folders on the device. |
COREWEBVIEW2_PERMISSION_KIND_AUTOPLAY | Indicates permission to play audio and video automatically on sites. |
COREWEBVIEW2_PERMISSION_KIND_LOCAL_FONTS | Indicates permission to use fonts on the device. |
COREWEBVIEW2_PERMISSION_KIND_MIDI_SYSTEM_EXCLUSIVE_MESSAGES | Indicates permission to send and receive system exclusive messages to/from MIDI (Musical Instrument Digital Interface) devices. |
COREWEBVIEW2_PERMISSION_KIND_WINDOW_MANAGEMENT | Indicates permission to open and place windows on the screen. |
Indicates the type of a permission request.
COREWEBVIEW2_PERMISSION_STATE
Values | Descriptions |
---|---|
COREWEBVIEW2_PERMISSION_STATE_DEFAULT | Specifies that the default browser behavior is used, which normally prompt users for decision. |
COREWEBVIEW2_PERMISSION_STATE_ALLOW | Specifies that the permission request is granted. |
COREWEBVIEW2_PERMISSION_STATE_DENY | Specifies that the permission request is denied. |
Specifies the response to a permission request.
COREWEBVIEW2_POINTER_EVENT_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_POINTER_EVENT_KIND_ACTIVATE | Corresponds to WM_POINTERACTIVATE. |
COREWEBVIEW2_POINTER_EVENT_KIND_DOWN | Corresponds to WM_POINTERDOWN. |
COREWEBVIEW2_POINTER_EVENT_KIND_ENTER | Corresponds to WM_POINTERENTER. |
COREWEBVIEW2_POINTER_EVENT_KIND_LEAVE | Corresponds to WM_POINTERLEAVE. |
COREWEBVIEW2_POINTER_EVENT_KIND_UP | Corresponds to WM_POINTERUP. |
COREWEBVIEW2_POINTER_EVENT_KIND_UPDATE | Corresponds to WM_POINTERUPDATE. |
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.
COREWEBVIEW2_PREFERRED_COLOR_SCHEME
Values | Descriptions |
---|---|
COREWEBVIEW2_PREFERRED_COLOR_SCHEME_AUTO | Auto color scheme. |
COREWEBVIEW2_PREFERRED_COLOR_SCHEME_LIGHT | Light color scheme. |
COREWEBVIEW2_PREFERRED_COLOR_SCHEME_DARK | Dark color scheme. |
An enum to represent the options for WebView2 color scheme: auto, light, or dark.
COREWEBVIEW2_PRINT_COLLATION
Values | Descriptions |
---|---|
COREWEBVIEW2_PRINT_COLLATION_DEFAULT | The default collation for a printer. |
COREWEBVIEW2_PRINT_COLLATION_COLLATED | Indicate that the collation has been selected for the printed output. |
COREWEBVIEW2_PRINT_COLLATION_UNCOLLATED | Indicate that the collation has not been selected for the printed output. |
Specifies the collation for a print.
COREWEBVIEW2_PRINT_COLOR_MODE
Values | Descriptions |
---|---|
COREWEBVIEW2_PRINT_COLOR_MODE_DEFAULT | The default color mode for a printer. |
COREWEBVIEW2_PRINT_COLOR_MODE_COLOR | Indicate that the printed output will be in color. |
COREWEBVIEW2_PRINT_COLOR_MODE_GRAYSCALE | Indicate that the printed output will be in shades of gray. |
Specifies the color mode for a print.
COREWEBVIEW2_PRINT_DIALOG_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_PRINT_DIALOG_KIND_BROWSER | Opens the browser print preview dialog. |
COREWEBVIEW2_PRINT_DIALOG_KIND_SYSTEM | Opens the system print dialog. |
Specifies the print dialog kind.
COREWEBVIEW2_PRINT_DUPLEX
Values | Descriptions |
---|---|
COREWEBVIEW2_PRINT_DUPLEX_DEFAULT | The default duplex for a printer. |
COREWEBVIEW2_PRINT_DUPLEX_ONE_SIDED | Print on only one side of the sheet. |
COREWEBVIEW2_PRINT_DUPLEX_TWO_SIDED_LONG_EDGE | Print on both sides of the sheet, flipped along the long edge. |
COREWEBVIEW2_PRINT_DUPLEX_TWO_SIDED_SHORT_EDGE | Print on both sides of the sheet, flipped along the short edge. |
Specifies the duplex option for a print.
COREWEBVIEW2_PRINT_MEDIA_SIZE
Values | Descriptions |
---|---|
COREWEBVIEW2_PRINT_MEDIA_SIZE_DEFAULT | The default media size for a printer. |
COREWEBVIEW2_PRINT_MEDIA_SIZE_CUSTOM | Indicate custom media size that is specific to the printer. |
Specifies the media size for a print.
COREWEBVIEW2_PRINT_ORIENTATION
Values | Descriptions |
---|---|
COREWEBVIEW2_PRINT_ORIENTATION_PORTRAIT | Print the page(s) in portrait orientation. |
COREWEBVIEW2_PRINT_ORIENTATION_LANDSCAPE | Print the page(s) in landscape orientation. |
The orientation for printing, used by the Orientation
property on ICoreWebView2PrintSettings.
COREWEBVIEW2_PRINT_STATUS
Values | Descriptions |
---|---|
COREWEBVIEW2_PRINT_STATUS_SUCCEEDED | Indicates that the print operation is succeeded. |
COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE | Indicates that the printer is not available. |
COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR | Indicates that the print operation is failed. |
Indicates the status for printing.
COREWEBVIEW2_PROCESS_FAILED_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_PROCESS_FAILED_KIND_BROWSER_PROCESS_EXITED | Indicates that the browser process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED | Indicates that the main frame's render process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE | Indicates that the main frame's render process is unresponsive. |
COREWEBVIEW2_PROCESS_FAILED_KIND_FRAME_RENDER_PROCESS_EXITED | Indicates that a frame-only render process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_UTILITY_PROCESS_EXITED | Indicates that a utility process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_SANDBOX_HELPER_PROCESS_EXITED | Indicates that a sandbox helper process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_GPU_PROCESS_EXITED | Indicates that the GPU process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_PPAPI_PLUGIN_PROCESS_EXITED | Indicates that a PPAPI plugin process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_PPAPI_BROKER_PROCESS_EXITED | Indicates that a PPAPI plugin broker process ended unexpectedly. |
COREWEBVIEW2_PROCESS_FAILED_KIND_UNKNOWN_PROCESS_EXITED | Indicates that a process of unspecified kind ended unexpectedly. |
Specifies the process failure type used in the ICoreWebView2ProcessFailedEventArgs 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.
COREWEBVIEW2_PROCESS_FAILED_REASON
Values | Descriptions |
---|---|
COREWEBVIEW2_PROCESS_FAILED_REASON_UNEXPECTED | An unexpected process failure occurred. |
COREWEBVIEW2_PROCESS_FAILED_REASON_UNRESPONSIVE | The process became unresponsive. |
COREWEBVIEW2_PROCESS_FAILED_REASON_TERMINATED | The process was terminated. For example, from Task Manager. |
COREWEBVIEW2_PROCESS_FAILED_REASON_CRASHED | The process crashed. |
COREWEBVIEW2_PROCESS_FAILED_REASON_LAUNCH_FAILED | The process failed to launch. |
COREWEBVIEW2_PROCESS_FAILED_REASON_OUT_OF_MEMORY | The process terminated due to running out of memory. |
COREWEBVIEW2_PROCESS_FAILED_REASON_PROFILE_DELETED | The process exited because its corresponding profile was deleted. |
Specifies the process failure reason used in the ICoreWebView2ProcessFailedEventArgs interface.
For process failures where a process has exited, it indicates the type of issue that produced the process exit.
COREWEBVIEW2_PROCESS_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_PROCESS_KIND_BROWSER | Indicates the browser process kind. |
COREWEBVIEW2_PROCESS_KIND_RENDERER | Indicates the render process kind. |
COREWEBVIEW2_PROCESS_KIND_UTILITY | Indicates the utility process kind. |
COREWEBVIEW2_PROCESS_KIND_SANDBOX_HELPER | Indicates the sandbox helper process kind. |
COREWEBVIEW2_PROCESS_KIND_GPU | Indicates the GPU process kind. |
COREWEBVIEW2_PROCESS_KIND_PPAPI_PLUGIN | Indicates the PPAPI plugin process kind. |
COREWEBVIEW2_PROCESS_KIND_PPAPI_BROKER | Indicates the PPAPI plugin broker process kind. |
Indicates the process type used in the ICoreWebView2ProcessInfo interface.
COREWEBVIEW2_RELEASE_CHANNELS
Values | Descriptions |
---|---|
COREWEBVIEW2_RELEASE_CHANNELS_NONE | No release channel. |
COREWEBVIEW2_RELEASE_CHANNELS_STABLE | The stable WebView2 Runtime that is released every 4 weeks. |
COREWEBVIEW2_RELEASE_CHANNELS_BETA | The Beta release channel that is released every 4 weeks, a week before the stable release. |
COREWEBVIEW2_RELEASE_CHANNELS_DEV | The Dev release channel that is released weekly. |
COREWEBVIEW2_RELEASE_CHANNELS_CANARY | The Canary release channel that is released daily. |
The WebView2 release channels.
Use ReleaseChannels
and ChannelSearchKind
on ICoreWebView2EnvironmentOptions to control which channel is searched for during environment creation.
Channel | Primary purpose | How often updated with new features |
---|---|---|
Stable (WebView2 Runtime) | Broad Deployment | Monthly |
Beta | Flighting with inner rings, automated testing | Monthly |
Dev | Automated testing, selfhosting to test new APIs and features | Weekly |
Canary | Automated testing, selfhosting to test new APIs and features | Daily |
COREWEBVIEW2_SCRIPT_DIALOG_KIND
Values | Descriptions |
---|---|
COREWEBVIEW2_SCRIPT_DIALOG_KIND_ALERT | Indicates that the dialog uses the window.alert JavaScript function. |
COREWEBVIEW2_SCRIPT_DIALOG_KIND_CONFIRM | Indicates that the dialog uses the window.confirm JavaScript function. |
COREWEBVIEW2_SCRIPT_DIALOG_KIND_PROMPT | Indicates that the dialog uses the window.prompt JavaScript function. |
COREWEBVIEW2_SCRIPT_DIALOG_KIND_BEFOREUNLOAD | Indicates that the dialog uses the beforeunload JavaScript event. |
Specifies the JavaScript dialog type used in the ICoreWebView2ScriptDialogOpeningEventHandler interface.
COREWEBVIEW2_SCROLLBAR_STYLE
Values | Descriptions |
---|---|
COREWEBVIEW2_SCROLLBAR_STYLE_DEFAULT | Browser default ScrollBar style. |
COREWEBVIEW2_SCROLLBAR_STYLE_FLUENT_OVERLAY | Window style fluent overlay scroll bar Please see Fluent UI for more details on fluent UI. |
Set ScrollBar style on ICoreWebView2EnvironmentOptions during environment creation.
COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION
Values | Descriptions |
---|---|
COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_ALWAYS_ALLOW | Indicates to ignore the warning and continue the request with the TLS certificate. |
COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_CANCEL | Indicates to reject the certificate and cancel the request. |
COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_DEFAULT | Indicates to display the default TLS interstitial error page to user for page navigations. |
Specifies the action type when server certificate error is detected to be used in the ICoreWebView2ServerCertificateErrorDetectedEventArgs interface.
COREWEBVIEW2_SHARED_BUFFER_ACCESS
Values | Descriptions |
---|---|
COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_ONLY | Script from web page only has read access to the shared buffer. |
COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_WRITE | Script from web page has read and write access to the shared buffer. |
Specifies the desired access from script to CoreWebView2SharedBuffer
.
COREWEBVIEW2_TRACKING_PREVENTION_LEVEL
Values | Descriptions |
---|---|
COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_NONE | Tracking prevention is turned off. |
COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BASIC | The least restrictive level of tracking prevention. |
COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BALANCED | The default level of tracking prevention. |
COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_STRICT | The most restrictive level of tracking prevention. |
Tracking prevention levels.
COREWEBVIEW2_WEB_ERROR_STATUS
Values | Descriptions |
---|---|
COREWEBVIEW2_WEB_ERROR_STATUS_UNKNOWN | Indicates that an unknown error occurred. |
COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_COMMON_NAME_IS_INCORRECT | Indicates that the SSL certificate common name does not match the web address. |
COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_EXPIRED | Indicates that the SSL certificate has expired. |
COREWEBVIEW2_WEB_ERROR_STATUS_CLIENT_CERTIFICATE_CONTAINS_ERRORS | Indicates that the SSL client certificate contains errors. |
COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_REVOKED | Indicates that the SSL certificate has been revoked. |
COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_IS_INVALID | Indicates that the SSL certificate is not valid. |
COREWEBVIEW2_WEB_ERROR_STATUS_SERVER_UNREACHABLE | Indicates that the host is unreachable. |
COREWEBVIEW2_WEB_ERROR_STATUS_TIMEOUT | Indicates that the connection has timed out. |
COREWEBVIEW2_WEB_ERROR_STATUS_ERROR_HTTP_INVALID_SERVER_RESPONSE | Indicates that the server returned an invalid or unrecognized response. |
COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED | Indicates that the connection was stopped. |
COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_RESET | Indicates that the connection was reset. |
COREWEBVIEW2_WEB_ERROR_STATUS_DISCONNECTED | Indicates that the Internet connection has been lost. |
COREWEBVIEW2_WEB_ERROR_STATUS_CANNOT_CONNECT | Indicates that a connection to the destination was not established. |
COREWEBVIEW2_WEB_ERROR_STATUS_HOST_NAME_NOT_RESOLVED | Indicates that the provided host name was not able to be resolved. |
COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED | Indicates that the operation was canceled. |
COREWEBVIEW2_WEB_ERROR_STATUS_REDIRECT_FAILED | Indicates that the request redirect failed. |
COREWEBVIEW2_WEB_ERROR_STATUS_UNEXPECTED_ERROR | Indicates that an unexpected error occurred. |
COREWEBVIEW2_WEB_ERROR_STATUS_VALID_AUTHENTICATION_CREDENTIALS_REQUIRED | Indicates that user is prompted with a login, waiting on user action. |
COREWEBVIEW2_WEB_ERROR_STATUS_VALID_PROXY_AUTHENTICATION_REQUIRED | Indicates that user lacks proper authentication credentials for a proxy server. |
Indicates the error status values for web navigations.
COREWEBVIEW2_WEB_RESOURCE_CONTEXT
Values | Descriptions |
---|---|
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL | Specifies all resources. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT | Specifies a document resource. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_STYLESHEET | Specifies a CSS resource. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE | Specifies an image resource. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MEDIA | Specifies another media resource such as a video. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FONT | Specifies a font resource. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SCRIPT | Specifies a script resource. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST | Specifies an XML HTTP request, Fetch and EventSource API communication. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FETCH | Specifies a Fetch API communication. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_TEXT_TRACK | Specifies a TextTrack resource. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_EVENT_SOURCE | Specifies an EventSource API communication. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_WEBSOCKET | Specifies a WebSocket API communication. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MANIFEST | Specifies a Web App Manifest. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SIGNED_EXCHANGE | Specifies a Signed HTTP Exchange. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_PING | Specifies a Ping request. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_CSP_VIOLATION_REPORT | Specifies a CSP Violation Report. |
COREWEBVIEW2_WEB_RESOURCE_CONTEXT_OTHER | Specifies an other resource. |
Specifies the web resource request contexts.
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS
Values | Descriptions |
---|---|
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_NONE | |
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_DOCUMENT | Indicates that web resource is requested from main page including dedicated workers and iframes. |
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SHARED_WORKER | Indicates that web resource is requested from shared worker. |
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SERVICE_WORKER | Indicates that web resource is requested from service worker. |
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_ALL | Indicates that web resource is requested from any supported source. |
Specifies the source of WebResourceRequested
event.
COREWEBVIEW2_COLOR
A value representing RGBA color (Red, Green, Blue, Alpha) for WebView2.
typedef COREWEBVIEW2_COLOR Each component takes a value from 0 to 255, with 0 being no intensity and 255 being the highest intensity.
CompareBrowserVersions
public STDAPI CompareBrowserVersions(PCWSTR version1, PCWSTR version2, int * result)
This method is for anyone want to compare version correctly to determine which version is newer, older or same.
Use it to determine whether to use webview2 or certain feature based upon version. Sets the value of result to -1
, 0
or 1
if version1
is less than, equal or greater than version2
respectively. Returns E_INVALIDARG
if it fails to parse any of the version strings or any input parameter is null
. Directly use the versionInfo
obtained from GetAvailableCoreWebView2BrowserVersionString
with input, channel information is ignored.
CreateCoreWebView2Environment
public STDAPI CreateCoreWebView2Environment(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler * environmentCreatedHandler)
Creates an evergreen WebView2 Environment using the installed WebView2 Runtime version.
This is equivalent to running CreateCoreWebView2EnvironmentWithOptions
with nullptr
for browserExecutableFolder
, userDataFolder
, additionalBrowserArguments
. For more information, navigate to CreateCoreWebView2EnvironmentWithOptions
.
CreateCoreWebView2EnvironmentWithOptions
public STDAPI CreateCoreWebView2EnvironmentWithOptions(PCWSTR browserExecutableFolder, PCWSTR userDataFolder, ICoreWebView2EnvironmentOptions * environmentOptions, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler * environmentCreatedHandler)
DLL export to create a WebView2 environment with a custom version of WebView2 Runtime, user data folder, and with or without additional options.
When WebView2 experimental APIs are used, make sure to provide a valid environmentOptions
so that WebView2 runtime knows which version of the SDK that the app is using. Otherwise, WebView2 runtime assumes that the version of the SDK being used is the latest version known to it, which might not be the version of the SDK being used. This wrong SDK version assumption could result in some experimental APIs not being available.
The WebView2 environment and all other WebView2 objects are single threaded and have dependencies on Windows components that require COM to be initialized for a single-threaded apartment. The app is expected to run CoInitializeEx
before running CreateCoreWebView2EnvironmentWithOptions
.
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
If CoInitializeEx
did not run or previously ran with COINIT_MULTITHREADED
, CreateCoreWebView2EnvironmentWithOptions
fails with one of the following errors.
CO_E_NOTINITIALIZED - if CoInitializeEx was not called
RPC_E_CHANGED_MODE - if CoInitializeEx was previously called with
COINIT_MULTITHREADED
Use browserExecutableFolder
to specify whether WebView2 controls use a fixed or installed version of the WebView2 Runtime that exists on a user machine. To use a fixed version of the WebView2 Runtime, pass the folder path that contains the fixed version of the WebView2 Runtime to browserExecutableFolder
. BrowserExecutableFolder supports both relative (to the application's executable) and absolute files paths. To create WebView2 controls that use the installed version of the WebView2 Runtime that exists on user machines, pass a null
or empty string to browserExecutableFolder
. In this scenario, the API tries to find a compatible version of the WebView2 Runtime that is installed on the user machine (first at the machine level, and then per user) using the selected channel preference. The path of fixed version of the WebView2 Runtime should not contain \Edge\Application\
. When such a path is used, the API fails with HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
.
By default, the channel search order is COREWEBVIEW2_CHANNEL_SEARCH_KIND_MOST_STABLE
, which means that environment creation searches for an installation in the following order: the WebView2 Runtime, Beta, Dev, and Canary. The channel search order is reversed when the ChannelSearchKind
property on ICoreWebView2EnvironmentOptions is set to COREWEBVIEW2_CHANNEL_SEARCH_KIND_LEAST_STABLE
, or when the corresponding environment variable or registry override is set to 1
. See below for descriptions of overrides. If ReleaseChannels
on ICoreWebView2EnvironmentOptions is provided, environment creation will only consider channels in this set, following the ChannelSearchKind
order.
You may specify the userDataFolder
to change the default user data folder location for WebView2. The path is either an absolute file path or a relative file path that is interpreted as relative to the compiled code for the current process. For UWP apps, the default user data folder is the app data folder for the package. For non-UWP apps, the default user data ({Executable File Name}.WebView2
) folder is created in the same directory next to the compiled code for the app. WebView2 creation fails if the compiled code is running in a directory in which the process does not have permission to create a new directory. The app is responsible to clean up the associated user data folder when it is done.
> [!NOTE]
> As a browser process may be shared among WebViews, WebView creation fails with HRESULT_FROM_WIN32(ERROR_INVALID_STATE)
if the specified options does not match the options of the WebViews that are currently running in the shared browser process.
environmentCreatedHandler
is the handler result to the async operation that contains the WebView2Environment
that was created.
The browserExecutableFolder
, channelSearchKind
, releaseChannels
, userDataFolder
and additionalBrowserArguments
of the environmentOptions
may be overridden by values either specified in environment variables or in the registry.
When creating a WebView2Environment
the following environment variables are verified.
WEBVIEW2_BROWSER_EXECUTABLE_FOLDER
WEBVIEW2_USER_DATA_FOLDER
WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS
WEBVIEW2_CHANNEL_SEARCH_KIND
WEBVIEW2_RELEASE_CHANNELS
If you find an override environment variable, use the browserExecutableFolder
and userDataFolder
values as replacements for the corresponding values in CreateCoreWebView2EnvironmentWithOptions
parameters. If additionalBrowserArguments
is specified in environment variable or in the registry, it is appended to the corresponding values in CreateCoreWebView2EnvironmentWithOptions
parameters. See ReleaseChannels
on ICoreWebView2EnvironmentOptions for more details on how to construct the registry key and environment variable values.
While not strictly overrides, additional environment variables may be set.
WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER
When found with a non-empty value, this indicates that the WebView is being launched under a script debugger. In this case, the WebView issues a Page.waitForDebugger
CDP command that runs the script inside the WebView to pause on launch, until a debugger issues a corresponding Runtime.runIfWaitingForDebugger
CDP command to resume the runtime.
> [!NOTE]
> The following environment variable does not have a registry key equivalent: WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER
.
When found with a non-empty value, it indicates that the WebView is being launched under a script debugger that also supports host apps that use multiple WebViews. The value is used as the identifier for a named pipe that is opened and written to when a new WebView is created by the host app. The payload should match the payload of the remote-debugging-port
JSON target and an external debugger may use it to attach to a specific WebView instance. The format of the pipe created by the debugger should be \\.\pipe\WebView2\Debugger\{app_name}\{pipe_name}
, where the following are true.
{app_name}
is the host app exe file name, for example,WebView2Example.exe
{pipe_name}
is the value set forWEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER
To enable debugging of the targets identified by the JSON, you must set the WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS
environment variable to send --remote-debugging-port={port_num}
, where the following is true.
{port_num}
is the port on which the CDP server binds.
> [!WARNING]
> If you set both WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER
and WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS
environment variables, the WebViews hosted in your app and associated contents may exposed to 3rd party apps such as debuggers.
> [!NOTE]
> The following environment variable does not have a registry key equivalent: WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER
.
If none of those environment variables exist, then the registry is examined next. The following registry values are verified.
[{Root}]\Software\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder
"{AppId}"=""
[{Root}]\Software\Policies\Microsoft\Edge\WebView2\ChannelSearchKind
"{AppId}"=""
[{Root}]\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannels
"{AppId}"=""
[{Root}]\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments
"{AppId}"=""
[{Root}]\Software\Policies\Microsoft\Edge\WebView2\UserDataFolder
"{AppId}"=""
You can use a group policy under Administrative Templates > Microsoft Edge WebView2 to configure browserExecutableFolder
, channelSearchKind
, and releaseChannels
.
In the unlikely scenario where some instances of WebView are open during a browser update, the deletion of the previous WebView2 Runtime may be blocked. To avoid running out of disk space, a new WebView creation fails with HRESULT_FROM_WIN32(ERROR_DISK_FULL)
if it detects that too many previous WebView2 Runtime versions exist.
The default maximum number of WebView2 Runtime versions allowed is 20
. To override the maximum number of the previous WebView2 Runtime versions allowed, set the value of the following environment variable.
COREWEBVIEW2_MAX_INSTANCES
If the Webview depends upon an installed WebView2 Runtime version and it is uninstalled, any subsequent creation fails with HRESULT_FROM_WIN32(ERROR_PRODUCT_UNINSTALLED)
.
First verify with Root as HKLM
and then HKCU
. AppId
is first set to the Application User Model ID of the process, then if no corresponding registry key, the AppId
is set to the compiled code name of the process, or if that is not a registry key then *
. A registry setting with *
as the value name will apply to all WebView2 apps, and cannot be used for the userDataFolder
option. If an override registry key is found, use the browserExecutableFolder
and userDataFolder
registry values as replacements and append additionalBrowserArguments
registry values for the corresponding values in CreateCoreWebView2EnvironmentWithOptions
parameters.
The following summarizes the possible error values that can be returned from CreateCoreWebView2EnvironmentWithOptions
and a description of why these errors occur.
Error value | Description |
---|---|
CO_E_NOTINITIALIZED |
CoInitializeEx was not called. |
RPC_E_CHANGED_MODE |
CoInitializeEx was previously called with COINIT_MULTITHREADED. |
HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) |
\Edge\Application path used in browserExecutableFolder. |
HRESULT_FROM_WIN32(ERROR_INVALID_STATE) |
Specified options do not match the options of the WebViews that are currently running in the shared browser process. |
HRESULT_FROM_WIN32(ERROR_DISK_FULL) |
In the unlikely scenario where some instances of WebView are open during a browser update, the deletion of the previous WebView2 Runtime may be blocked. To avoid running out of disk space, a new WebView creation fails with HRESULT_FROM_WIN32(ERROR_DISK_FULL) if it detects that too many previous WebView2 Runtime versions exist. |
HRESULT_FROM_WIN32(ERROR_PRODUCT_UNINSTALLED) |
If the Webview depends upon an installed WebView2 Runtime version and it is uninstalled. |
HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) |
Could not find Edge installation. |
HRESULT_FROM_WIN32(ERROR_FILE_EXISTS) |
User data folder cannot be created because a file with the same name already exists. |
E_ACCESSDENIED |
Unable to create user data folder, Access Denied. |
E_FAIL |
Edge runtime unable to start. |
CreateWebViewEnvironmentWithOptionsInternal
public STDAPI CreateWebViewEnvironmentWithOptionsInternal(bool checkRunningInstance, int runtimeType, PCWSTR userDataFolder, IUnknown * environmentOptions, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler * webViewEnvironmentCreatedHandler)
This is a DLL export out of EmbeddedBrowserWebView.dll
which can be found in the installation folder of the WebView2 Runtime you wish to use.
Note
This function may be modified or removed in future versions. It is recommended you use CreateCoreWebView2EnvironmentWithOptions
instead of this function.
This function creates a WebView2 environment with a specified version of WebView2 Runtime, user data folder, and with or without additional options.
This is an internal method used by CreateCoreWebView2EnvironmentWithOptions
that acts similar to CreateCoreWebView2EnvironmentWithOptions
, but it will only create an ICoreWebView2Environment from the WebView2 Runtime of the module on which you call CreateWebViewEnvironmentWithOptionsInternal
. This is unlike CreateCoreWebView2EnvironmentWithOptions
which handles many other cases including: falling back to other non-stable WebView2 Runtime channels when the stable WebView2 Runtime is not available, handling developer environment variables to change the runtime, handling policy registry keys to change the runtime, and others. You should use CreateCoreWebView2EnvironmentWithOptions
rather than this method.
If checkRunningInstance
is set then CreateWebViewEnvironmentWithOptionsInternal
will forward the creation call to a different WebView2 Runtime if there is already a different WebView2 Runtime running for the specified user data folder. This matches CreateCoreWebView2EnvironmentWithOptions
behavior. If not set, then this forwarding will not occur and creation will fail if there is already a different WebView2 Runtime running for the specified user data folder.
The runtimeType
parameter is used to indicate if the WebView2 Runtime is fixed version with value 1
, evergreen with value 0
, or unknown with value -1
.
See the CreateCoreWebView2EnvironmentWithOptions
documentation for information on the userDataFolder
, environmentOptions
, and webViewEnvironmentCreatedHandler
parameters which match the parameters from CreateCoreWebView2EnvironmentWithOptions
.
GetAvailableCoreWebView2BrowserVersionString
public STDAPI GetAvailableCoreWebView2BrowserVersionString(PCWSTR browserExecutableFolder, LPWSTR * versionInfo)
Get the browser version info including channel name if it is not the WebView2 Runtime.
Channel names are Beta, Dev, and Canary. If an override exists for the browserExecutableFolder
or the channel preference, the override is used. If an override is not specified, then the parameter value passed to GetAvailableCoreWebView2BrowserVersionString
is used. Returns HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
if it fails to find an installed WebView2 runtime or non-stable Microsoft Edge installation.
The caller must free the returned string with CoTaskMemFree
. See API Conventions.
GetAvailableCoreWebView2BrowserVersionStringWithOptions
public STDAPI GetAvailableCoreWebView2BrowserVersionStringWithOptions(PCWSTR browserExecutableFolder, ICoreWebView2EnvironmentOptions * environmentOptions, LPWSTR * versionInfo)
This function will tell you the browser version info of the release channel used when creating an environment with the same options.
Browser version info includes channel name if it is not the WebView2 Runtime. Channel names are Beta, Dev, and Canary. The format of the return string matches the format of BrowserVersionString
on ICoreWebView2Environment.
If an override exists for browserExecutableFolder
, releaseChannels
, or ChannelSearchKind
, the override is used. The presence of an override can result in a different channel used than the one expected based on the environment options object. browserExecutableFolder
takes precedence over the other options, regardless of whether or not its channel is included in the releaseChannels
. See CreateCoreWebView2EnvironmentWithOptions
for more details on overrides. If an override is not specified, then the parameters passed to GetAvailableCoreWebView2BrowserVersionStringWithOptions
are used. Returns HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
if it fails to find an installed WebView2 Runtime or non-stable Microsoft Edge installation. Use GetAvailableCoreWebView2BrowserVersionString
to get the version info without the environment options.
The caller must free the returned string with CoTaskMemFree
. See API Conventions.