The "Browscap.ini" file is used to declare properties and to set default values for browsers.
This section is not a tutorial on how to maintain "Browscap.ini" files, it only shows you the basics; so you get an idea what the file is all about.
The "Browscap.ini" file can contain the following:
[;comments]
[HTTPUserAgentHeader]
[parent=browserDefinition]
[property1=value1]
[propertyN=valueN]
[Default Browser Capability Settings]
[defaultProperty1=defaultValue1]
[defaultPropertyN=defaultValueN]
[HTTPUserAgentHeader]
[parent=browserDefinition]
[property1=value1]
[propertyN=valueN]
[Default Browser Capability Settings]
[defaultProperty1=defaultValue1]
[defaultPropertyN=defaultValueN]
Parameter | Description |
---|---|
comments | Optional. Any line that starts with a semicolon are ignored by the BrowserType object |
HTTPUserAgentHeader | Optional. Specifies the HTTP User Agent header to associate with the browser-property value statements specified in propertyN. Wildcard characters are allowed |
browserDefinition | Optional. Specifies the HTTP User Agent header-string of a browser to use as the parent browser. The current browser's definition will inherit all of the property values declared in the parent browser's definition |
propertyN | Optional. Specifies the browser properties. The following table lists some possible properties:
|
valueN | Optional. Specifies the value of propertyN. Can be a string, an integer (prefix with #), or a Boolean value |
defaultPropertyN | Optional. Specifies the name of the browser property to which to assign a default value if none of the defined HTTPUserAgentHeader values match the HTTP User Agent header sent by the browser |
defaultValueN | Optional. Specifies the value of defaultPropertyN. Can be a string, an integer (prefix with #), or a Boolean value |
A "Browscap.ini" file might look something like this:
;IE 5.0
[IE 5.0]
browser=IE
Version=5.0
majorver=#5
minorver=#0
frames=TRUE
tables=TRUE
cookies=TRUE
backgroundsounds=TRUE
vbscript=TRUE
javascript=TRUE
javaapplets=TRUE
ActiveXControls=TRUE
beta=False
;DEFAULT BROWSER
[*]
browser=Default
frames=FALSE
tables=TRUE
cookies=FALSE
backgroundsounds=FALSE
vbscript=FALSE
javascript=FALSE
[IE 5.0]
browser=IE
Version=5.0
majorver=#5
minorver=#0
frames=TRUE
tables=TRUE
cookies=TRUE
backgroundsounds=TRUE
vbscript=TRUE
javascript=TRUE
javaapplets=TRUE
ActiveXControls=TRUE
beta=False
;DEFAULT BROWSER
[*]
browser=Default
frames=FALSE
tables=TRUE
cookies=FALSE
backgroundsounds=FALSE
vbscript=FALSE
javascript=FALSE
Practice Excercise Practice now