logo

class

web::UserAgent

sys::Obj
  web::UserAgent

UserAgent identifies a user agent.

Slots

fromStr

new fromStr(Str userAgentStr)

Construct a new UserAgent with this user agent string.

isFirefox

readonly Bool isFirefox

Is this user agent Mozilla Firefox.

isIE

readonly Bool isIE

Is this user agent Microsoft Internet Explorer.

isOpera

readonly Bool isOpera

Is this agent Opera.

isSafari

readonly Bool isSafari

Is this agent Apple Safari.

toStr

override Str toStr()

Return a string representation of this object. The result of this method will match the original Str that was used to parse this UserAgent.

tokens

readonly Str[] tokens

The tokens identifying this user agent in the order they were parsed. This list is readonly.

version

readonly Version version

The primary version for this user agent. This field is only valid if the user agent is IE, Firefox, Safari, or Opera. For all other browsers, or if the above list has an invalid version string, this field will default to "0.0".