Web View2 Class
WebView2 enables you to host web content using the latest Microsoft Edge browser and web technology.
public class CoreWebView2
type CoreWebView2 = class
Public Class CoreWebView2
Gets the process ID of the browser process that hosts the WebView.
Indicates if the WebView contains a fullscreen HTML element.
Gets the title for the current top-level document.
Whether WebView is suspended.
Gets the CoreWebView2Settings object contains various modifiable settings for the running WebView.
Gets the URI of the current top level document.
Adds the provided host object to script running in the WebView with the specified name.
Adds a URI and resource context filter to the WebResourceRequested event.
Runs an asynchronous DevToolsProtocol method.
Captures an image of what WebView is displaying.
Clears a host name mapping for local folder that was added by SetVirtualHostNameToFolderMapping(String, String, CoreWebView2HostResourceAccessKind).
Gets a DevTools Protocol event receiver that allows you to subscribe to a DevToolsProtocol event.
Navigates the WebView to the previous page in the navigation history.
Navigates the WebView to the next page in the navigation history.
Causes a navigation of the top level document to the specified URI.
Initiates a navigation to
Navigates using a constructed CoreWebView2WebResourceRequest object.
Opens the DevTools window for the current document in the WebView.
Posts the specified
Reloads the current page.
Removes a matching WebResource filter that was previously added for the WebResourceRequested event.
Resumes the WebView so that it resumes activities on the web page.
|SetVirtualHostNameToFolderMapping(String, String, CoreWebView2HostResourceAccessKind)||
Sets a mapping between a virtual host name and a folder path to make available to web sites via that host name.
Stops all navigations and pending resource fetches.
An app may call this API to have the WebView2 consume less memory.
ContainsFullScreenElementChanged is raised when the ContainsFullScreenElement property changes.
ContentLoading is raised before any content is loaded, including scripts added with AddScriptToExecuteOnDocumentCreatedAsync(String). ContentLoading is not raised if a same page navigation occurs (such as through fragment navigations or
DOMContentLoaded is raised when the initial HTML document has been parsed.
FrameNavigationCompleted is raised when a child frame has completely loaded (
FrameNavigationStarting is raised when a child frame in the WebView requests permission to navigate to a different URI.
HistoryChanged is raised when there is change of navigation history for the top level document.
NavigationCompleted is raised when the WebView has completely loaded (
NavigationStarting is raised when the WebView main frame is requesting permission to navigate to a different URI.
NewWindowRequested is raised when content inside the WebView requests to open a new window, such as through
PermissionRequested is raised when content in a WebView requests permission to access some privileged resources.
ProcessFailed is raised when a WebView process ends unexpectedly or becomes unresponsive.
SourceChanged is raised when the Source property changes.
WebMessageReceived is raised when the IsWebMessageEnabled setting is set and the top-level document of the WebView runs
WebResourceRequested is raised when the WebView is performing a URL request to a matching URL and resource context filter that was added with AddWebResourceRequestedFilter(String, CoreWebView2WebResourceContext).
WebResourceResponseReceived is raised when the WebView receives the response for a request for a web resource (any URI resolution performed by the WebView; such as HTTP/HTTPS, file and data requests from redirects, navigations, declarations in HTML, implicit favicon lookups, and fetch API usage in the document). The host app can use this event to view the actual request and response for a web resource. There is no guarantee about the order in which the WebView processes the response and the host app's handler runs. The app's handler will not block the WebView from processing the response.
WindowCloseRequested is raised when content inside the WebView requested to close the window, such as after