The IE10 User-Agent String
We recently announced
IE10 Platform Preview 1. Aside from
some exciting
new
features,
this platform preview also includes the new IE10
user-agent string:
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:
- The value of the “MSIE” token is now “10.0”
- The value of the “Trident” token is now “6.0”
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)
Does this affect me?
Ideally, very few people should care about these changes. In particular, those of
you
using
feature
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.
Call to action
Download IE10
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
Comments
Anonymous
April 15, 2011
Nice to see it being done properly! I checked my regex code and it's coded fine and wont have any trouble with IE10. Though I only have to worry about IE less than or equal to 8 :) IE9 copes with any modern code I throw at it and gets it right. This makes me happy!Anonymous
April 15, 2011
I would have preferred "Trident/6.0 (compatible; MSIE 10.0; Windows NT 6.1)". Shorter and more realistic.Anonymous
April 15, 2011
FremyCompany: I agree. It's time to get rid of this "Mozzila" thing :)Anonymous
April 15, 2011
Isn't it time to finally drop "Mozilla"? What about MSIE/10.0 (Windows NT 6.1; Trident/6.0)Anonymous
April 15, 2011
Just remember that a dot in regular expression captures any character. So, you should use: var matchIE = /MSIEs([d.]+)/ Instead of the regex of the text. Just add a backslash before the dot.Anonymous
April 15, 2011
Marcos, dot in square brackets is just a dot.Anonymous
April 15, 2011
The comment has been removedAnonymous
April 15, 2011
Can you please provide VPC images for IE9 and IE10?Anonymous
April 15, 2011
The comment has been removedAnonymous
April 15, 2011
@Tony Ross [MSFT] 1- What does "Mozilla/5.0" do or mean or achieve in terms of relevance and usefulness? a) for web authors? b) for website admins? What purpose does "Mozilla/5.0" serve in an IE user agent string? Is there a meaning, a goal served by "Mozilla/5.0" in an IE10 user agent string? Is there a meaning, a goal served by "Mozilla/5.0" in an IE user agent string in 2011+? 2- What does "compatible;" do or mean or achieve in terms of relevance and usefulness? a) for web authors? b) for website admins? What purpose does "compatible;" serve in an IE user agent string? Is there a meaning, a goal served by "compatible;" in an IE10 user agent string? Is there a meaning, a goal served by "compatible;" in an IE user agent string in 2011+? I fully agree with and support FremyCompany, LorenzoDV and others who are inviting you to clean up/shrink this user agent string to bare minimum, to reliable, useful and relevant info. regards, Gérard TalbotAnonymous
April 15, 2011
Agree with many other comments so far, clean it up and get rid of the irrelavent old bits, since the number 10 is going to cause some problems with bad UA detection anyway, you might as well deal with mozilla and compatable at the same time.Anonymous
April 15, 2011
@Gérard Talbot: By adding Mozilla to their user agent they pay tribute to the great achievements by Mozilla/Netscape. ;-)Anonymous
April 15, 2011
yeah time to drop the Mozilla/5.0 (sending that header out is pointless and waste of bandwith)not to mention kinda oldAnonymous
April 15, 2011
The comment has been removedAnonymous
April 15, 2011
How about removing Mozilla for standards mode, and leaving it in for compatibility mode ?Anonymous
April 15, 2011
Remove Mozilla in Standards mode if it will make the browser load faster... if removing mozilla will slow down IE then keep it... Mozilla sounds like something the devs of Mozilla Firefox would use :PAnonymous
April 15, 2011
Please release IE10 for Windows Vista. The point isn't whether Vista is a good product or bad. It's a current supported product and longetivity/backward compatibility was one of the flagship features of the Windows platform. Vista is a release just before the current release. Because Windows 8 is far from release, IE10 SHOULD HAVE BEEN MADE FOR WINDOWS VISTA. There should be a class action lawsuit against this shameless greedy corporation for giving such heinous treatment to a product just earlier than the latest. Even Apple supports the latest OS and the one before it.Anonymous
April 15, 2011
Nice to see the MS addressing an issue early, but far more importantly, putting the onus on those who have been doing it wrong in the first place, to fix their code. I can think of many other decisions where this wasn't done.Anonymous
April 15, 2011
I have submitted a bug about the issue with IE10's user-agent string in ASP.NET, and the general problem with ASP.NET user-agent sniffing: connect.microsoft.com/.../asp-net-user-agent-sniffing-and-ie10-internet-explorer-10 Cordially, Alexandre http://alexandre.alapetite.frAnonymous
April 15, 2011
Should we start a protest together with a lot of people and start surfing the preview with a user agent string like this: MSIE 10.0 (Trident/6.0; Windows NT 6.1)Anonymous
April 15, 2011
The second regex (/MSIEs([d.]+)/) is incorrect. A '.' matches any char. What you meant was: /MSIEs([d.]+)/ The IE team has gotten really gansta. This page has an obvious styling bug in chrome and also every MS download center page does not work in chrome at all (button unclickable). The incompatibility incidences on MS properties become more and more. I also often notice that text in other browsers than IE is blurry on this blog. You surely did notice that, did you!Anonymous
April 16, 2011
Well, it is never too late to walk down the wrong path. Browser sniffing is not the way to go.
- Use standards.
- Use media queries
Anonymous
April 16, 2011
Microsoft you making IE10 for only windows 7 and windows 8 is a wonderful idea! that means a faster IE and no more old windows users using microsoft IE. They might all go to google chrome or firefox :) http://www.google.com/chrome http://getfirerfox.com/Anonymous
April 16, 2011
@tobi: No. In a character class, the only characters that must be escaped are the backslash (), the closed square bracket (]) the caret (^) and the hyphen (-). A dot, in this context, is just a dot (wouldn't make much sense otherwise now, would it?) It's advisable to actually check the documentation before making a disparaging comment, especially when the very same point was raised (and contested) just a few comments ago.Anonymous
April 16, 2011
I fully agree with Gérard Talbot. Nobody considers anymore "Mozilla/5.0" or "compatible" in User-Agent Strings, I think they are completely useless at now.Anonymous
April 16, 2011
My suggestion: "MSIE10"Anonymous
April 16, 2011
Hello Microsoft you should change from mozilla to MSIE cause It makes you sound like you are using Mozilla firefox's string.. like Google chrome's string should change to googlechrome :P Doing This will stop Crashie.com forever.. Trust me :) i am the owner.. Mozilla in the string is causing IE to crash.Anonymous
April 16, 2011
User Agent String Documentation blogs.msdn.com/.../459541.aspx The IE7 User-Agent String blogs.msdn.com/.../763891.aspx The Internet Explorer 8 User-Agent String blogs.msdn.com/.../763891.aspx Introducing IE9’s User Agent String blogs.msdn.com/.../introducing-ie9-s-user-agent-string.aspxAnonymous
April 16, 2011
if i choose URL and right click then Firefox and Chrome both give me facility to go to ... who's url i selected but this's not included in IE.Anonymous
April 16, 2011
The comment has been removedAnonymous
April 16, 2011
Microsoft this is the time to prove to us that you listen to us all. REMOVE FRICKIN Mozilla/4.0 ALREADY!!!Anonymous
April 16, 2011
I think removing the "compatible;" token would improve compatibility, since it's used to detect IE and serve malformed content.Anonymous
April 16, 2011
The comment has been removedAnonymous
April 16, 2011
The way to go is like this MSIE 10.0.1.1234 (product+version and no more stuff)Anonymous
April 17, 2011
Please consider adjusting the problems relating select tag, such as .innerHTML and others=> throbs.net/.../IE-SELECT-bugsAnonymous
April 17, 2011
funny, crashie.com wont crash my ie9 8-0Anonymous
April 17, 2011
Sorry for being OT, couldn't helped it. Please fwd to the IE team ;-) www.youtube.com/watch These guys are from the mono team, so they don't dislike MSFT.Anonymous
April 17, 2011
Funnily enough, Safari, Chrome, Firefox and Opera all prefix their user-agent strings 'Mozilla/5.0', so what's with all this hating towards IE 10 all of a sudden?Anonymous
April 17, 2011
On http://test262.ecmascript.org, IE9 fails 276 out of 10872 tests compared to FF4.0.1 fails 296 and IE10prev fails only 3 !! That’s impressive !Anonymous
April 17, 2011
@Mihai, that's not true of Opera, at least not of the latest versions running with default settings. @DanglingPointer, that does sound impressive!Anonymous
April 18, 2011
The user agent should look like this... MSIE 10.0; Windows NT 5.2; Trident/6.0 MSIE 10.0; Windows NT 6.0; Trident/6.0 MSIE 10.0; Windows NT 6.1; Trident/6.0 Keep it for compatibility mode, that would make sense though bad habits like this need to stop. It would also be nice if Chrome and Safari stopped declaring they were Gecko and KHTML based browsers as they are not. Microsoft is not Mozilla either. Also as Eric pointed out years ago that older sites would break...well if they're online they're being hosted and if they're being hosted someone is paying money to keep them online. With the required ICANN notifications about keeping account contact information up to date even if an email address or contact form is not available on the site itself we can still do a whois and contact people who have sites with broken code if need be. Broken code should break...because standards compliant code should work. ;-) Thanks btw to Gérard. :-)Anonymous
April 18, 2011
Chrome sync my password and bookmark through my Google acount. so if i even crash my system or go anywhere else i can use them. if something goes wrong no problem becuase it's safe in IE their is no good way to do bookmark prehaps you nothing make changes from IE6. the same fundamentals i use but nothing found better. well are you planning for making bookmark like Firefox instead of going ot live page in IE. so their is hard to keep bookmark and password backup or safe. i found nothing or not any good way to try it in IE9 when i try so are their any plan to make it usable. hope feedback help you [well thing i point you alredy realize] when i find that you use Chrome 12 nighly as same as me in mix11 then i feel that you not your eye close but maybe your thinking for making IE better. no doubt both better in place [chrome and IE]. first thing in IE that every feature should be perfect instead of making blah blah blah( because MSFT with MVP and some other person make lot's of blah and someone create spamming on twitter , facebook no matter here for that). i know you not make millions of plugin in month but can improve the feature exisitng in IE.Anonymous
April 18, 2011
The comment has been removedAnonymous
April 18, 2011
@Mihai > Safari, Chrome, Firefox and Opera all prefix their user-agent strings 'Mozilla/5.0', so what's with all this hating towards IE 10 all of a sudden? I can not speak for others but I have been trying to be consistently on topic throughout many years in this blog and always trying to propose an alternative or a suggestion to replace whatever is being done in IE. Mentioning what other browsers do may be useful if the related issue discussed is outside the spec. This is the case here with user agent string: there is no known official (ECMA, W3C, IETF, etc) standard for user agent string. Maybe there should be. You say "hating" when I would rather say "persistent request for sound, clear and clean user agent string" throughout 5½ years. I share your opinion that other browsers have all kinds of irrelevant, unneeded and contradictory strings in their user agent string and navigator object's attributes (eg @RP navigator.appCodeName in latest Opera nevertheless returns the illogical "Mozilla"). Mentioning other browsers' issues and problems here is not useful in this blog and is not really on topic. Hello JAB Creations :) regards, Gérard TalbotAnonymous
April 18, 2011
@Gérard - Presumably the reason that all browsers continue to include Mozilla in their user agent strings is because a significant number of sites don't render correctly otherwise. Yes, those sites are badly written, yes it would be nice not to worry about legacy, but unfortunately this is what the real world is like.Anonymous
April 18, 2011
@Tom - Those websites are probably very old ones and, therefore, they probably need the compatibility mode anyway.Anonymous
April 19, 2011
The comment has been removedAnonymous
April 19, 2011
I have no idea how many web sites are affected, but the fact that all browser makers have made the same call makes me assume the number is not insignificant. Suppose one major browser maker (doesn't matter who) decides to get rid of the Mozilla bit "for the good of the web". My prediction is that users of that browser would get upset that the browser does not correctly render some sites. And in all likeilhood the web site isn't being actively maintained, so there won't be any developers to notice the problem, let alone fix it. So there doesn't seem to be a lot in it for a browser maker to make this change, and (unless I'm missing something) keeping the legacy stuff in the user agent string is pretty benign.Anonymous
April 19, 2011
If sending twenty bytes * number of pages (+files) you download on the web is pretty benign then, yes, "keeping the legacy stuff in the user agent string is pretty benign". But if you don't change someday, you never change. Clutters accumulate, and you end up with the Chrome user agent: "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16".Anonymous
April 20, 2011
@Tom Many years ago, when people relied on user agent string detection to select, to discriminate browser names and browser versions, they did not need (and wouldn't need anyway) to detect "Mozilla" and "compatible". That's not what they did. Firefox 3.6+, Opera 11 and Chrome 10 user-agent strings do not have "compatible". Opera 11 user-agent string does not have "Mozilla" (albeit navigator.appCodeName returns "Mozilla") If a website is unmaintained during years, then chances are (it's more likely) thatt he visitors do not keep coming back. Browser manufacturers (Microsoft, Mozilla, Google, Opera, Apple and KDE) just need to start talking to each other and reach a consensus, create an industry standard and issue a RFC on user agent string. And then we'll see the next major releases of those browsers with a clean, compact and standardized user agent string. @FremyCompany 1- "Windows" is even unneedlessly repeated in your quoted Chrome 10 user-agent string. 2- navigator.appName returns "Netscape" in Chrome 10! 3- "WebKit", "KHTML" and "Gecko" (all present in Chrome 10 user-agent string) are the names of 3 different and distinct rendering engines: these are pitfalls for user-agent string detection. 4- Chances are navigator.language in your Chrome 10 returns "fr" while we see "en-US": this is my case, btw. My Chrome 10 GUI is in French but the user-agent string suggests it's in english (en-US). So, at best, it misleads here too. regards, Gérard Talbot