📜 ⬆️ ⬇️

jQuery in no hurry to recognize Google Chrome?

Since the last stable release of jQuery, which took place at the end of May of this year, there have been many significant events, such as, for example, the release of Firefox 3 and Google Chrome browsers.

In jQuery, there is a built-in browser object that performs the definition of what you yourself understand. At the current moment (in the trunk ) the browser is implemented like this:

  var userAgent = navigator.userAgent.toLowerCase ();

 // Figure out what browser is being used

 jQuery.browser = {
	 version: (userAgent.match (/.+(?:rv|it|ra|ie)[\/:] ([\ d.] +) /) || [0, '0']) [1],
	 safari: /webkit/.test (userAgent),
	 opera: /opera/.test (userAgent),
	 msie: /msie/.test (userAgent) &&! /opera/.test (userAgent),
	 mozilla: /mozilla/.test (userAgent) &&! / (compatible | webkit) /. test (userAgent)
 }; 

No mention of chrome. No, I understand, of course, that chrome has not yet come out of deep beta, and if there is anything to expand the browser there is no problem. Another thing is unclear: why Sir Resig ignores one of the most promising browsers.

')

Source: https://habr.com/ru/post/46601/


All Articles