test_agents.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. // Copyright 2013 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the 'License');
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an 'AS-IS' BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @fileoverview Various User-Agent strings.
  16. * See http://go/useragentexamples and http://www.useragentstring.com/ for
  17. * examples.
  18. *
  19. * @author martone@google.com (Andy Martone)
  20. */
  21. goog.provide('goog.labs.userAgent.testAgents');
  22. goog.setTestOnly('goog.labs.userAgent.testAgents');
  23. goog.scope(function() {
  24. var testAgents = goog.labs.userAgent.testAgents;
  25. /** @const {string} */
  26. testAgents.ANDROID_BROWSER_235 =
  27. 'Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; ' +
  28. 'HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) ' +
  29. 'Version/4.0 Mobile Safari/533.1';
  30. /** @const {string} */
  31. testAgents.ANDROID_BROWSER_221 =
  32. 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83)' +
  33. ' AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1';
  34. /** @const {string} */
  35. testAgents.ANDROID_BROWSER_233 =
  36. 'Mozilla/5.0 (Linux; U; Android 2.3.3; en-us; HTC_DesireS_S510e' +
  37. ' Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0' +
  38. ' Mobile Safari/533.1';
  39. /** @const {string} */
  40. testAgents.ANDROID_BROWSER_403 =
  41. 'Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K)' +
  42. ' AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30';
  43. /** @const {string} */
  44. // User agent retrieved from dremel queries for cases matching b/13222688
  45. testAgents.ANDROID_BROWSER_403_ALT =
  46. 'Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K)' +
  47. ' AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30';
  48. // Chromium for Android. Found in Android 4.4+ devices based on AOSP, but never
  49. // in the 'Google' devices (where only Google Chrome is shipped).
  50. // UA string matches Chromium based WebView exactly, see ANDROID_WEB_VIEW_4_4.
  51. /** @const {string} */
  52. testAgents.ANDROID_BROWSER_4_4 =
  53. 'Mozilla/5.0 (Linux; Android 4.4.2; S8 Build/KOT49H) ' +
  54. 'AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 ' +
  55. 'Chrome/30.0.0.0 Mobile Safari/537.36';
  56. // See https://developer.chrome.com/multidevice/user-agent
  57. /** @const {string} */
  58. testAgents.ANDROID_WEB_VIEW_4_1_1 =
  59. 'Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Build/KLP) ' +
  60. 'AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30';
  61. // See https://developer.chrome.com/multidevice/user-agent
  62. /** @const {string} */
  63. testAgents.ANDROID_WEB_VIEW_4_4 =
  64. 'Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) ' +
  65. 'AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 ' +
  66. 'Chrome/30.0.0.0 Mobile Safari/537.36';
  67. /** @const {string} */
  68. testAgents.IE_6 = 'Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1;' +
  69. '.NET CLR 2.0.50727)';
  70. /** @const {string} */
  71. testAgents.IE_7 = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)';
  72. /** @const {string} */
  73. testAgents.IE_8 =
  74. 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)';
  75. /** @const {string} */
  76. testAgents.IE_8_COMPATIBILITY =
  77. 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)';
  78. /** @const {string} */
  79. testAgents.IE_9 =
  80. 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)';
  81. /** @const {string} */
  82. testAgents.IE_9_COMPATIBILITY =
  83. 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0)';
  84. /** @const {string} */
  85. testAgents.IE_10 =
  86. 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
  87. /** @const {string} */
  88. testAgents.IE_10_COMPATIBILITY =
  89. 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)';
  90. /**
  91. * http://blogs.windows.com/windows_phone/b/wpdev/archive/2012/10/17/getting-websites-ready-for-internet-explorer-10-on-windows-phone-8.aspx
  92. * @const {string}
  93. */
  94. testAgents.IE_10_MOBILE =
  95. 'Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ' +
  96. 'IEMobile/10.0; ARM; Touch; NOKIA; Lumia 820)';
  97. /** @const {string} */
  98. testAgents.IE_11 =
  99. 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';
  100. /** @const {string} */
  101. testAgents.IE_11_COMPATIBILITY_MSIE_7 =
  102. 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; ' +
  103. '.NET4.0E; .NET4.0C)';
  104. /** @const {string} */
  105. testAgents.IE_11_COMPATIBILITY_MSIE_9 =
  106. 'Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; WOW64; Trident/7.0; ' +
  107. 'rv:11.0) like Gecko';
  108. /**
  109. * https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396#edge
  110. * @const {string}
  111. */
  112. testAgents.EDGE_12_0 =
  113. 'Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 ' +
  114. '(KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36 Edge/12.0';
  115. /** @const {string} */
  116. testAgents.EDGE_12_9600 =
  117. 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +
  118. '(KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.9600';
  119. /** @const {string} */
  120. testAgents.FIREFOX_19 =
  121. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) ' +
  122. 'Gecko/20100101 Firefox/19.0';
  123. /** @const {string} */
  124. testAgents.FIREFOX_LINUX =
  125. 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:15.0) Gecko/20100101' +
  126. ' Firefox/15.0.1';
  127. /** @const {string} */
  128. testAgents.FIREFOX_MAC =
  129. 'Mozilla/6.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4)' +
  130. ' Gecko/2012010317 Firefox/10.0a4';
  131. /** @const {string} */
  132. testAgents.FIREFOX_WINDOWS =
  133. 'Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507' +
  134. ' Firefox/14.0.1';
  135. /** @const {string} */
  136. testAgents.SAFARI_6 = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_1) ' +
  137. 'AppleWebKit/536.25 (KHTML, like Gecko) ' +
  138. 'Version/6.0 Safari/536.25';
  139. /** @const {string} */
  140. testAgents.SAFARI_IPHONE_32 =
  141. 'Mozilla/5.0(iPhone; U; CPU iPhone OS 3_2 like Mac OS X; en-us)' +
  142. ' AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314' +
  143. ' Safari/531.21.10';
  144. /** @const {string} */
  145. testAgents.SAFARI_IPHONE_421 =
  146. 'Mozilla/5.0 (iPhone; U; ru; CPU iPhone OS 4_2_1 like Mac OS X; ru)' +
  147. ' AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148a' +
  148. ' Safari/6533.18.5';
  149. /** @const {string} */
  150. testAgents.SAFARI_IPHONE_431 =
  151. 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_1 like Mac OS X; zh-tw)' +
  152. ' AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8G4' +
  153. ' Safari/6533.18.5';
  154. /** @const {string} */
  155. testAgents.SAFARI_IPHONE_6 =
  156. 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X)' +
  157. ' AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e' +
  158. ' Safari/8536.25';
  159. /** @const {string} */
  160. testAgents.SAFARI_IPOD =
  161. 'Mozila/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1' +
  162. ' (KHTML, like Gecko) Version/3.0 Mobile/3A101a Safari/419.3';
  163. /** @const {string} */
  164. testAgents.SAFARI_MAC =
  165. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+' +
  166. ' (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2';
  167. /** @const {string} */
  168. testAgents.SAFARI_WINDOWS =
  169. 'Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25' +
  170. ' (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27';
  171. /** @const {string} */
  172. testAgents.COAST =
  173. 'Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1' +
  174. ' (KHTML like Gecko) Coast/1.1.2.64598 Mobile/11B511 Safari/7534.48.3';
  175. /** @const {string} */
  176. testAgents.WEBVIEW_IPHONE =
  177. 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26' +
  178. ' (KHTML, like Gecko) Mobile/10A403';
  179. /** @const {string} */
  180. testAgents.WEBVIEW_IPAD =
  181. 'Mozilla/5.0 (iPad; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26' +
  182. ' (KHTML, like Gecko) Mobile/10A403';
  183. /** @const {string} */
  184. testAgents.OPERA_MINI =
  185. 'Opera/9.80 (Android; Opera Mini/7.6.35766/35.5706; U; en)' +
  186. ' Presto/2.8.119 Version/11.10';
  187. /** @const {string} */
  188. testAgents.OPERA_10 = 'Opera/9.80 (S60; SymbOS; Opera Mobi/447; U; en) ' +
  189. 'Presto/2.4.18 Version/10.00';
  190. /** @const {string} */
  191. testAgents.OPERA_LINUX =
  192. 'Opera/9.80 (X11; Linux x86_64; U; fr) Presto/2.9.168 Version/11.50';
  193. /** @const {string} */
  194. testAgents.OPERA_MAC =
  195. 'Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168' +
  196. ' Version/11.52';
  197. /** @const {string} */
  198. testAgents.OPERA_15 =
  199. 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 ' +
  200. '(KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36 OPR/15.0.1147.100';
  201. /** @const {string} */
  202. testAgents.IPAD_4 = 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us)' +
  203. ' AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b' +
  204. ' Safari/531.21.10';
  205. /** @const {string} */
  206. testAgents.IPAD_5 =
  207. 'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X; en-us) AppleWebKit/534.46' +
  208. ' (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3';
  209. /** @const {string} */
  210. testAgents.IPAD_6 = 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) ' +
  211. 'AppleWebKit/536.26 (KHTML, like Gecko) ' +
  212. 'Version/6.0 Mobile/10A403 Safari/8536.25';
  213. /** @const {string} */
  214. testAgents.CHROME_25 = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) ' +
  215. 'AppleWebKit/535.8 (KHTML, like Gecko) ' +
  216. 'Chrome/25.0.1000.10 Safari/535.8';
  217. /** @const {string} */
  218. testAgents.CHROME_ANDROID =
  219. 'Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) ' +
  220. 'AppleWebKit/535.7 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile ' +
  221. 'Safari/535.7';
  222. /** @const {string} */
  223. testAgents.CHROME_ANDROID_PHONE_4_4 =
  224. 'Mozilla/5.0 (Linux; Android 4.4.2; S8 Build/KOT49H) ' +
  225. 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Mobile ' +
  226. 'Safari/537.36';
  227. /** @const {string} */
  228. testAgents.CHROME_ANDROID_TABLET =
  229. 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) ' +
  230. 'AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Safari/535.19';
  231. /** @const {string} */
  232. testAgents.CHROME_ANDROID_TABLET_4_4 =
  233. 'Mozilla/5.0 (Linux; Android 4.4.4; Nexus 7 Build/KTU84P) ' +
  234. 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Safari/537.36';
  235. /** @const {string} */
  236. testAgents.CHROME_IPHONE =
  237. 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X; en-us) ' +
  238. 'AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/22.0.1194.0 Mobile/11E53 ' +
  239. 'Safari/7534.48.3';
  240. /** @const {string} */
  241. testAgents.CHROME_IPAD = 'Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) ' +
  242. 'AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/32.0.1700.20 ' +
  243. 'Mobile/11B554a Safari/9537.53';
  244. /** @const {string} */
  245. testAgents.CHROME_LINUX =
  246. 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko)' +
  247. ' Chrome/26.0.1410.33 Safari/537.31';
  248. /**
  249. * We traditionally use Appversion to detect X11
  250. * @const {string}
  251. */
  252. testAgents.CHROME_LINUX_APPVERVERSION =
  253. '5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko)' +
  254. ' Chrome/26.0.1410.33 Safari/537.31';
  255. /** @const {string} */
  256. testAgents.CHROME_MAC =
  257. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17' +
  258. ' (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17';
  259. /** @const {string} */
  260. testAgents.CHROME_OS =
  261. 'Mozilla/5.0 (X11; CrOS x86_64 3701.62.0) AppleWebKit/537.31 ' +
  262. '(KHTML, like Gecko) Chrome/26.0.1410.40 Safari/537.31';
  263. /** @const {string} */
  264. testAgents.CHROME_OS_910 =
  265. 'Mozilla/5.0 (X11; U; CrOS i686 9.10.0; en-US) AppleWebKit/532.5' +
  266. ' (KHTML, like Gecko) Chrome/4.0.253.0 Safari/532.5';
  267. /** @const {string} */
  268. testAgents.KINDLE_FIRE =
  269. 'Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K)' +
  270. ' AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.1 Mobile Safari/535.19' +
  271. ' Silk-Accelerated=true';
  272. /** @const {string} */
  273. testAgents.FIREFOX_ANDROID_TABLET =
  274. 'Mozilla/5.0 (Android; Tablet; rv:28.0) Gecko/28.0 Firefox/28.0';
  275. }); // goog.scope