CoreWebView2Profile Class

Definition

Multiple profiles can be created under a single user data directory but with separated cookies, user preference settings, and various data storage etc.. If the CoreWebView2 was created with a CoreWebView2ControllerOptions, the CoreWebView2Profile will match those specified options. Otherwise if this CoreWebView2 was created without a CoreWebView2ControllerOptions, then this will be the default CoreWebView2Profile for the corresponding CoreWebView2Environment.

public class CoreWebView2Profile
type CoreWebView2Profile = class
Public Class CoreWebView2Profile
Inheritance
CoreWebView2Profile

Properties

CookieManager

Get the CoreWebView2CookieManager which Creates, adds or updates, gets, or or view the cookies for the current profile.

DefaultDownloadFolderPath

The default download folder path.

IsGeneralAutofillEnabled

Determines whether general form information will be saved and autofilled.

IsInPrivateModeEnabled

InPrivate mode is enabled or not.

IsPasswordAutosaveEnabled

Determines whether password information will be autosaved.

PreferredColorScheme

The PreferredColorScheme property sets the overall color scheme of the WebView2s associated with this profile.

PreferredTrackingPreventionLevel

The PreferredTrackingPreventionLevel property allows you to control levels of tracking prevention for WebView2 which are associated with a profile. This level would apply to the context of the profile. That is, all WebView2s sharing the same profile will be affected and also the value is persisted in the user data folder.

ProfileName

The name of the profile.

ProfilePath

Full path of the profile directory.

Methods

AddBrowserExtensionAsync(String)

Add a browser extension to the current user profile from extensionFolderPath.

ClearBrowsingDataAsync()

Clear the entirety of the browsing data associated with the profile it is called on. It clears the data regardless of timestamp.

ClearBrowsingDataAsync(CoreWebView2BrowsingDataKinds)

Clear the browsing data of the associated profile.

ClearBrowsingDataAsync(CoreWebView2BrowsingDataKinds, DateTime, DateTime)

Clear the browsing data for the specified dataKinds between the startTime and endTime. Overload the ClearBrowsingDataAsync method to allow for additional time parameters.

ClearCustomDataPartitionAsync(String)

Clears all DOM storage and cookies in the specified custom data partition.

Delete()

Delete this profile.

GetBrowserExtensionsAsync()

Gets a snapshot of the set of extensions on current user profile.

GetNonDefaultPermissionSettingsAsync()

Invokes the handler with a collection of all nondefault permission settings.

SetPermissionStateAsync(CoreWebView2PermissionKind, String, CoreWebView2PermissionState)

Sets permission state for the given permission kind and origin asynchronously.

Events

Deleted

Raised when profile is marked for deletion.

Applies to