From Xojo Documentation

Property (As String )
aHTMLViewer.UserAgent = newStringValue
StringValue = aHTMLViewer.UserAgent

New in 2011r1

Supported for all project types and targets.

Supports getting and setting a custom user agent string. It is in the Open event of the control.


UserAgent works on macOS and Windows (using the Native Renderer). Changing it has no effect on Linux or when on Windows using the WebKit Renderer.


This example sets the UserAgent.

If Me.IsAvailable Then
Dim agent As String
agent = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16"
Me.UserAgent = agent
End If