Built-in version properties

 

BrowserHawk provides several built-in properties related to the version information contained within a user agent. These properties are set automatically by AVD, but can be overridden if desired with your own values. Note that these version properties are a core part of BrowserHawk, and may not be renamed or deleted.

 

The following is a description of each built-in version property and its purpose:

 

Majorver (integer): This property holds the browser’s major version number. The major version number is considered by AVD to be the number on the left hand side of the first (and possibly only) decimal in the version number.

 

Examples:

Majorver = 3 for "Mozilla/3.01 (WinNT; I)"

Majorver = 3 for "Lynx/3.2.11"

 

Minorver (double): This property holds the browser’s minor version number. The minor version number is considered by AVD to be the number on the right hand side of the first (and possibly only) decimal in the version number. If the version contains multiple decimal places, the minor version is still just the number to the left without adding those less significant additional digits in the other decimal places.

 

Examples:

Minorver = 0.01 for "Mozilla/3.01 (WinNT; I)"

Minorver = 0.40 for "Lynx/2.40.11"

 

Note: Under browscap.ini, these values would be "1" and "40" instead. Refer to the property differences between BrowserHawk and browscap.ini for more information.

 

Minorverlet (string): This property holds the browser’s version number letter, if it has one (many do not). A letter following the version number is only considered part of the version number by AVD if it falls immediately next to the last digit in the version number (with no preceding spaces), and is not followed by another letter or digit immediately after it, unless separated by a space.

 

Examples:

Minorverlet = "a" for "Mozilla/3.01a (WinNT; I)"

Minorverlet = "" for "Mozilla/3.01b1 (WinNT; I)"

Minorverlet = "" for "Mozilla/3.01 (WinNT; I)"

 

Version (double): This property holds the browser’s Majorver and Minorver combined. Note that this is a numeric property which does not contain the Minorverlet for purposes of numeric comparisons (i.e. "if browser.version < 4.03").

 

Examples:

Version = 3.01 for "Mozilla/3.01a (WinNT; I)"

 

Fullversion (string): This property holds the browser’s entire version number, including less significant decimal digits and any version letter if it exists. Note that this property is a string and should not be used for numeric comparisons.

 

Examples:

Fullversion = "3.01" for "Mozilla/3.01 (WinNT; I)"

Fullversion = "2.40.11" for "Lynx/2.40.11"

Fullversion = "2.40.11.9c" for "Lynx/2.40.11.9c libwww 1.7666"

 

 

Versionpos (integer): Some user agent strings report more than one version number. This property is used by AVD to determine which version number in the string it should use as the basis for populating the version number properties, and can be varied as needed for each browser definition.

 

If Versionpos = 0 (default) or 1, AVD will use the first version number in the user agent. Otherwise, AVD will use the version number in the position specified by the Versionpos property. Note that unlike the other built-in version properties, this property is not populated with any version information – it is solely for providing information to BrowserHawk’s AVD. Therefore you will not likely reference this value from your scripts.

 

Example, with Versionpos = 0 or 1:

AVD uses 4.0 as the version number for:

"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)"

Note: For this user agent you would want Versionpos set to 2 as shown below.

 

Example, with Versionpos = 2:

AVD uses 5.01 as the version number for:

"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)"

 

 Example, with Versionpos = 3:

AVD uses 2.14 as the version number for:

"Lynx_ALynx/2.4 AmigaPort/1.29 libwww/2.14"

 

Versionposx (integer): Acts just like Versionpos, except that it accepts negative numbers, allowing you to move backwards through the user agent to find the right version number. If Versionposx is positive than it acts just like Versionpos. If both Versionposx and Versionpos are set, Versionposx takes priority.

 

Example, with Versionposx = -1

 AVD uses 9.0 as the version number for:

  " Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Opera 9.0 [en]"

 

Example, with Versionposx = -2

 AVD uses 5.1 as the version number for:

  " Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Opera 9.0 [en]"

 

Versionposstr (string): Acts as a marker to indicate to BrowserHawk that the position count should start relative to the first version number found after the Versionposstr string is matched in the user agent. The Versionposx property is then used to gather the version number from a relative position from that version number, or to get that version number if Versionposx is set to 1.

 

Example, with Versionpostr = "Opera" and Versionposx = 1

 AVD uses 9.0 (correct) as the version number for:

  " Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Opera 9.0 [en]"

 

Example, with Versionpostr = "Opera" and Versionposx = 1

 AVD uses 7.5 (correct) as the version number for:

  " Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Opera 9.0 [en] Ice 2.0"

 

Example, with Versionpostr not set and Versionposx = -1

 AVD uses 2.0 (incorrect) as the version number for:

  " Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Opera 9.0 [en] Ice 2.0"

 

Example, with Versionpostr = "Opera" and Versionposx = -1

 AVD uses 5.1 (incorrect) as the version number for:

  " Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Opera 9.0 [en] Ice 2.0"

 

Tip: The information is for reference only. It is never necessary for you to change or worry about the Versionpos, Versionposstr, or Versionposx properties unless you are creating your own custom browser definitions, as cyScape handles this for you as part of your software maintenance through the BDF updates.

 

 

See Also:

Converting from browscap.ini

Testing browser definitions

Hiding version properties

Working with properties