UplevelHelperDefinitions.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Browser data from http://www.seehowitruns.org/
  4. The purpose of this file is to describe, in the shortest possible way,
  5. the browsers that have support for JavaScript. Since it is not
  6. possible to determine in 100% if a visiting browser has support for
  7. JavaScript we are left with our best guess based on the User-Agent
  8. header contents. Note that the header may, of course, be faked and
  9. completely bogus - thus we do not have to go out of our way in order
  10. to be 100% correct and accurate.
  11. The important thing to remember about this file before adding any
  12. entries to it is that it serves the purpose of finding BROWSERS that
  13. DO support JavaScript and not blocking bots etc. that do NOT support
  14. JavaScript.
  15. The file should be kept as short as possible, because that way the
  16. matching we need to do at the beginning of every request will be fast
  17. (the entries contained below define 99% of the cases and the generated
  18. code is able to match nearly 90000 lines of unique browser strings in
  19. under 0.015s).
  20. The syntax is simple:
  21. 1. Two tags are supported: group and except
  22. 1a. The <group> tag
  23. The tag takes several attributes:
  24. - positions
  25. Specifies a section of the User-Agent string which should be
  26. probed for match. Syntax:
  27. X[-Y][,X[-Y]] ...
  28. where both X and Y are digits. Positions are _zero based_
  29. (i.e. the first character of the User-Agent string is at position
  30. 0). Several position ranges can be specified, they must be
  31. separated with a comma.
  32. Generated code checks the U-A string only at the specified
  33. positions.
  34. - scanfrom
  35. Specifies an index in the User-Agent string from which the code
  36. should scan for the value specified in the 'match' attribute.
  37. Generated code scans the U-A string from this position, moving one
  38. position ahead with each iteration and trying to match the
  39. specified value starting from each position.
  40. NOTE: 'positions' and 'scanfrom' cannot be specified together and one
  41. of them must be specified in order for the compiler to process the
  42. definition correctly.
  43. - skip
  44. Specifies the number of initial positions to skip when 'scanfrom'
  45. is used. It is a bit superfluous, as it would be possible to
  46. specify 'scanfrom' taking the offset into account, but the idea is
  47. that the definition editor can see the whole context when given
  48. the "absolute start" and the offset while looking at the agent
  49. string.
  50. - match
  51. Specifies the string to look for in the U-A header. Used with both
  52. 'scanfrom' and 'positions' attributes. The difference is that with
  53. 'positions' match *MUST* contain the same number of of parts as
  54. the 'position' attribute (also separated by commas). Also in the
  55. 'positions' case, match parts must be equal in length to the
  56. specified 'positions' ranges.
  57. This attribute is always required.
  58. - javascript
  59. Specifies the default return value of the group. Defaults to
  60. 'false'.
  61. 1b. The 'except' tag
  62. Defines an exception to the default return value of the group it is
  63. defined in. The attributes are the same what in the 'group' tag
  64. above. When a match is made on the 'except' clause, the return value
  65. is reverse to the group default.
  66. Exceptions are rendered _before_ the subgroups.
  67. 2. Overall syntax
  68. The 'group' container tags can be nested to any depth and can
  69. also contain the 'except' tags.
  70. The 'except' tags can be specified only within a group.
  71. Unknown tags are silently ignored.
  72. -->
  73. <uplevel>
  74. <group positions="0-3" match="Mozi">
  75. <!-- Mozilla and compatibles -->
  76. <group positions="7-10" match="/4.0" javascript="true">
  77. <!-- MSIE, Netscape 4.0, Opera -->
  78. <except positions="13-28" match="ActiveTouristBot"/>
  79. </group>
  80. <!-- IE9 or newer -->
  81. <group positions="7-10" match="/5.0" javascript="true">
  82. <!-- MSIE 10, MSIE 11 -->
  83. <except positions="13-28" match="ActiveTouristBot"/>
  84. </group>
  85. <group scanfrom="12" skip="4" match=") Gecko/" javascript="true">
  86. <!-- All the Gecko-based browsers -->
  87. </group>
  88. <group scanfrom="12" skip="4" match=") Opera" javascript="true">
  89. <!-- Opera -->
  90. </group>
  91. <group positions="12-15" match="(Mac" javascript="true">
  92. <!-- Safari -->
  93. </group>
  94. <group scanfrom="12" skip="2" match="(KHTML" javascript="true">
  95. <!-- Safari -->
  96. </group>
  97. <group positions="12-15" match="Gale" javascript="true">
  98. <!-- Galeon < 2.0 -->
  99. </group>
  100. <group positions="25-28" match="Konq" javascript="true">
  101. <!-- Konqueror -->
  102. </group>
  103. <group positions="9-11,12" match="/4.,[" javascript="true">
  104. <!-- Netscape 4.x -->
  105. </group>
  106. </group>
  107. <group positions="0-3" match="Konq" javascript="true">
  108. <!-- Konqueror -->
  109. </group>
  110. <group positions="0-3" match="Oper" javascript="true">
  111. <!-- Opera -->
  112. </group>
  113. </uplevel>