
UserAgent identifies a user agent.
Slots
- 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.
- make
-
new make(Str userAgentStr)
Construct a new UserAgent with this user agent string.
-
internal Version parseVer(Str s)
Parse this version string into a Version object. This method is more forgiving than straight Version.fromStr(). It will strip out invalid characters and attempt to return a reasonable version match. Returns null if nothing could be salvaged.
"7.0b" -> 7.0 "2.1a2" -> 2.1 "1b" -> 1 "abc" -> null
- 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
-
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".