[TYPO3-dev] BrowserInfo going beserk...

Steffen Kamper info at sk-typo3.de
Sat May 22 15:57:26 CEST 2010


Hi,

Jigal van Hemert schrieb:

> I found the following 'strange' combinations also on the useragentstring 
> website:
> [snip] 

i don't care these ones, they are seldom and imho wrong, i don't like to 
correct redonds mess.

> 
> Conclusions:
> ============
> 
> MSIE has #msie\s([\d.a-z]*)#i
> The left-most version found is correct, but if it is version 7.0 and 
> there is 'Trident/...' in the UA then it is IE8 in compatibility mode.
> 
> Safari has often #safari([ /]((?<= |/)[\d.]*))?#i the last part is *not* 
> the version however. Starting with version 2.2 it also has #version([ 
> /]((?<= |/)[\d.]*))?#i (the last part is the version). Befor that 
> version it may be the AppleWebKit/<version> which indirectly indicates 
> the version number. Some versions of Safari do not have 'safari' in the 
> UA!?
> 
> Chrome has #chrome/([\d.]*)#i and has so far always "safari" in the UA
> 
> Firefox has #firefox([ /]((?<= |/)[\d.a-z]*))?#i
> 
> Opera has #opera([ /]((?<= |/)[\d.]*))?#i and may have other browser 
> names in the UA.
> 
> 
> IE compatibility mode
> =====================
> The problem here is: how do you treat IE in compatiblity mode? It's like 
> when you recognize uncle Jerry dressed up as Santa Claus when he comes 
> to visit. Do you play along and treat him like Santa and ask him what he 
> wants to drink, or will you immediately serve him his favourite drink 
> (diet Coke)?
> For statistics I would say IE8, for layout (loading different versions 
> of CSS, JS, images, etc.) I would go for IE7. But how can this be solved 
> for TS conditions?
> 
> *) detection by http://www.useragentstring.com/
> 

With compatibility mode: i think if IE is in compatibility mode it 
behaves like one version lower. So IE8 + compatibility = IE7
I don't see a sense in different handling of this mode. If IE8 + comp. 
mode, detection will see IE7, and i think this is correct then.

The TS detection for chrome, firefox and opera works. Indeed there are 
some strange things like safari's version number. The problem also is, 
that the UA strings doesn't follow a standard, so any browser can send 
what he likes to send. i also don't understand why chrome sends safari 
after chrome.

vg Steffen




More information about the TYPO3-dev mailing list