3c1f479b9d
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
138 lines
4.8 KiB
XML
138 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
Browser data from http://www.seehowitruns.org/
|
|
|
|
The purpose of this file is to describe, in the shortest possible way,
|
|
the browsers that have support for JavaScript. Since it is not
|
|
possible to determine in 100% if a visiting browser has support for
|
|
JavaScript we are left with our best guess based on the User-Agent
|
|
header contents. Note that the header may, of course, be faked and
|
|
completely bogus - thus we do not have to go out of our way in order
|
|
to be 100% correct and accurate.
|
|
The important thing to remember about this file before adding any
|
|
entries to it is that it serves the purpose of finding BROWSERS that
|
|
DO support JavaScript and not blocking bots etc. that do NOT support
|
|
JavaScript.
|
|
The file should be kept as short as possible, because that way the
|
|
matching we need to do at the beginning of every request will be fast
|
|
(the entries contained below define 99% of the cases and the generated
|
|
code is able to match nearly 90000 lines of unique browser strings in
|
|
under 0.015s).
|
|
|
|
The syntax is simple:
|
|
|
|
1. Two tags are supported: group and except
|
|
|
|
1a. The <group> tag
|
|
|
|
The tag takes several attributes:
|
|
|
|
- positions
|
|
Specifies a section of the User-Agent string which should be
|
|
probed for match. Syntax:
|
|
|
|
X[-Y][,X[-Y]] ...
|
|
|
|
where both X and Y are digits. Positions are _zero based_
|
|
(i.e. the first character of the User-Agent string is at position
|
|
0). Several position ranges can be specified, they must be
|
|
separated with a comma.
|
|
Generated code checks the U-A string only at the specified
|
|
positions.
|
|
|
|
- scanfrom
|
|
Specifies an index in the User-Agent string from which the code
|
|
should scan for the value specified in the 'match' attribute.
|
|
Generated code scans the U-A string from this position, moving one
|
|
position ahead with each iteration and trying to match the
|
|
specified value starting from each position.
|
|
|
|
NOTE: 'positions' and 'scanfrom' cannot be specified together and one
|
|
of them must be specified in order for the compiler to process the
|
|
definition correctly.
|
|
|
|
- skip
|
|
Specifies the number of initial positions to skip when 'scanfrom'
|
|
is used. It is a bit superfluous, as it would be possible to
|
|
specify 'scanfrom' taking the offset into account, but the idea is
|
|
that the definition editor can see the whole context when given
|
|
the "absolute start" and the offset while looking at the agent
|
|
string.
|
|
|
|
- match
|
|
Specifies the string to look for in the U-A header. Used with both
|
|
'scanfrom' and 'positions' attributes. The difference is that with
|
|
'positions' match *MUST* contain the same number of of parts as
|
|
the 'position' attribute (also separated by commas). Also in the
|
|
'positions' case, match parts must be equal in length to the
|
|
specified 'positions' ranges.
|
|
This attribute is always required.
|
|
|
|
- javascript
|
|
Specifies the default return value of the group. Defaults to
|
|
'false'.
|
|
|
|
1b. The 'except' tag
|
|
Defines an exception to the default return value of the group it is
|
|
defined in. The attributes are the same what in the 'group' tag
|
|
above. When a match is made on the 'except' clause, the return value
|
|
is reverse to the group default.
|
|
Exceptions are rendered _before_ the subgroups.
|
|
|
|
2. Overall syntax
|
|
The 'group' container tags can be nested to any depth and can
|
|
also contain the 'except' tags.
|
|
The 'except' tags can be specified only within a group.
|
|
Unknown tags are silently ignored.
|
|
|
|
-->
|
|
<uplevel>
|
|
<group positions="0-3" match="Mozi">
|
|
<!-- Mozilla and compatibles -->
|
|
<group positions="7-10" match="/4.0" javascript="true">
|
|
<!-- MSIE, Netscape 4.0, Opera -->
|
|
<except positions="13-28" match="ActiveTouristBot"/>
|
|
</group>
|
|
<!-- IE9 or newer -->
|
|
<group positions="7-10" match="/5.0" javascript="true">
|
|
<!-- MSIE 10, MSIE 11 -->
|
|
<except positions="13-28" match="ActiveTouristBot"/>
|
|
</group>
|
|
<group scanfrom="12" skip="4" match=") Gecko/" javascript="true">
|
|
<!-- All the Gecko-based browsers -->
|
|
</group>
|
|
|
|
<group scanfrom="12" skip="4" match=") Opera" javascript="true">
|
|
<!-- Opera -->
|
|
</group>
|
|
|
|
<group positions="12-15" match="(Mac" javascript="true">
|
|
<!-- Safari -->
|
|
</group>
|
|
|
|
<group scanfrom="12" skip="2" match="(KHTML" javascript="true">
|
|
<!-- Safari -->
|
|
</group>
|
|
|
|
<group positions="12-15" match="Gale" javascript="true">
|
|
<!-- Galeon < 2.0 -->
|
|
</group>
|
|
|
|
<group positions="25-28" match="Konq" javascript="true">
|
|
<!-- Konqueror -->
|
|
</group>
|
|
|
|
<group positions="9-11,12" match="/4.,[" javascript="true">
|
|
<!-- Netscape 4.x -->
|
|
</group>
|
|
</group>
|
|
|
|
<group positions="0-3" match="Konq" javascript="true">
|
|
<!-- Konqueror -->
|
|
</group>
|
|
|
|
<group positions="0-3" match="Oper" javascript="true">
|
|
<!-- Opera -->
|
|
</group>
|
|
</uplevel>
|