CoreWebView2Settings.UserAgent Property

Definition

Determines WebView2's User Agent.

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

Property Value

Examples

WebViewSettings.UserAgent = dialog.Input.Text;

Remarks

The default value is the default User Agent of the Edge browser. This property may be overridden if the User-Agent header is set in a request. If the parameter is empty the User Agent will not be updated and the current User Agent will remain. Setting this property may clear User Agent Client Hints headers Sec-CH-UA-* and script values from navigator.userAgentData. Current implementation behavior is subject to change.

Applies to