We recently announced
IE10 Platform Preview 1. Aside from
this platform preview also includes the new IE10
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
Overall this represents a natural evolution of
the IE9 user-agent string with only two changes:
Also, Compatibility View still maps to IE7 Standards Mode just like in IE8 and IE9.
Here the user-agent string mimics IE7 for compatibility, but the “Trident” token
is now “6.0” to signify IE10 is in use.
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)
Ideally, very few people should care about these changes. In particular, those of
detection exclusively can sit back and relax.
However if your site is still using
user-agent sniffing, then increasing the “MSIE” token to “10.0” is particularly
noteworthy. Why? Because it adds an extra digit to the string value of the token.
Most sites will handle this effortlessly, but some will process the extra digit
incorrectly, causing them to identify IE10 as IE1.
To help illustrate, here’s a regular expression that only captures the first digit
of the “MSIE” token’s value:
// INCORRECT: will report IE10 version in capture 1 as "1"
var matchIE = /MSIE\s(\d)/;
And here’s one that captures the full value of the “MSIE” token:
// Correct: will report IE10 version in capture 1 as "10.0"
var matchIE = /MSIE\s([\d.]+)/
Of course your code may look significantly different depending on your choice of
programming language, approach to string parsing, etc. Those of you with custom
HTTPS configurations on Apache may also want to read
this blog post by Eric Lawrence.
Platform Preview 1 to test how your site responds to IE10’s user-agent string.
Update your user-agent sniffing logic if necessary, or even better, consider migrating
to feature detection to make worrying about changes like this a thing of the past.
—Tony Ross, Program Manager, Internet Explorer