Contents - Index - Top


UserAgent

Interface AntView 

 

Type: Property

Access: Read/Write

Data Type: String

 

 

Used to set or get the User Agent string for the Edge control. By default it will use the Edge browser user agent.

You can only set this after the WebView2 control has been initiated.

For example in the event OnCreateWebViewCompleted.

 

Example in Visual Basic:

 

 

Private Sub EdgeWebBrowser_OnCreateWebviewCompleted(ByVal HResult As Long)

  EdgeWebBrowser.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"

End Sub

 

There is currently a bug report open against WebView2 for the User Agent feature, which you can find here:WebView2 Feedback issue 2862 Setting UserAgent not effective on first navigation.

 .

 


AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/25/2024