CoreWebView2ControllerOptions Class

Definition

Used to manage profile options that created by CreateCoreWebView2ControllerOptions().

public class CoreWebView2ControllerOptions
type CoreWebView2ControllerOptions = class
Public Class CoreWebView2ControllerOptions
Inheritance
CoreWebView2ControllerOptions

Properties

AllowHostInputProcessing

AllowHostInputProcessing property is to enable/disable input passing through the app before being delivered to the WebView2. This property is only applicable to controllers created with CoreWebView2Environment.CreateCoreWebView2ControllerAsync and not composition controllers created with CoreWebView2Environment.CreateCoreWebView2CompositionControllerAsync. By default the value is FALSE. Setting this property has no effect when using visual hosting. \snippet AppWindow.cpp AllowHostInputProcessing

DefaultBackgroundColor

This property allows users to initialize the DefaultBackgroundColor early, preventing a white flash that can occur while WebView2 is loading when the background color is set to something other than white. With early initialization, the color remains consistent from the start. After initialization, CoreWebView2Controller.DefaultBackgroundColor will return the value set using this API.

        The `CoreWebView2Controller.DefaultBackgroundColor` can be set via the WEBVIEW2_DEFAULT_BACKGROUND_COLOR environment variable,
        which will remain supported for cases where this solution is being used.
        It is encouraged to transition away from the environment variable and use this API solution to
        apply the property. It is important to highlight that when set, the enviroment variable overrides 
        ControllerOptions::DefaultBackgroundColor and becomes the initial value of Controller::DefaultBackgroundColor.

        The `DefaultBackgroundColor` is the color that renders underneath all web
        content. This means WebView2 renders this color when there is no web 
        content loaded. When no background color is defined in WebView2, it uses
        the `DefaultBackgroundColor` property to render the background.
        By default, this color is set to white.

        This API only supports opaque colors and full transparency. It will
        fail for colors with alpha values that don't equal 0 or 255.
        When WebView2 is set to be fully transparent, it does not render a background,
        allowing the content from windows behind it to be visible.
IsInPrivateModeEnabled

Manage the controller's InPrivate mode.

LocaleRegion

Manages the value of the controller's locale region.

ProfileName

Manage the name of the controller's profile.

ScriptLocale

Manages the value of the controller's script locale.

Applies to