Partilhar via


CoreWebView2EnvironmentOptions.AdditionalBrowserArguments Property

Definition

Gets or sets the additional browser arguments to change the behavior of the WebView.

public string AdditionalBrowserArguments { get; set; }
member this.AdditionalBrowserArguments : string with get, set
Public Property AdditionalBrowserArguments As String

Property Value

Remarks

The arguments are passed to the browser process as part of the command. For more information about using command-line switches with Chromium browser processes, navigate to Run Chromium with Flags. The value appended to a switch is appended to the browser process, for example, in --edge-webview-switches=xxx the value is xxx. If you specify a switch that is important to WebView functionality, it is ignored, for example, --user-data-dir. Specific features are disabled internally and blocked from being enabled. If a switch is specified multiple times, only the last instance is used.

A merge of the different values of the same switch is not attempted, except for disabled and enabled features. The features specified by --enable-features and --disable-features will be merged with simple logic:

- The features are the union of the specified features and built-in features. If a feature is disabled, it is removed from the enabled features list.

If you specify command-line switches and sets this property, the --edge-webview-switches value takes precedence and is processed last. If a switch fails to parse, the switch is ignored. The default state for the operation is to run the browser process with no extra flags.

Please note that calling this API twice will replace the previous value rather than appending to it. If there are multiple switches, there should be a space in between them. The one exception is if multiple features are being enabled/disabled for a single switch, in which case the features should be comma-separated. Ex. "--disable-features=feature1,feature2 --some-other-switch --do-something"

Applies to