DesktopHTMLViewer.UserAgent

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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

New in 2021r3

Supported for all project types and targets.

Supports getting and setting a custom user agent string.

Notes

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.

Example

This example sets the UserAgent.

If Me.IsAvailable Then
Var 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