A quick note on the Beta 2 Preview user agent string


The information published in this post is now out-of-date and one or more links are invalid.

—IEBlog Editor, 17 September 2012

At the end of April of last year, we blogged about the new Internet Explorer 7 User Agent string.  Since our original blog posting, we have also posted two new articles on this topic to MSDN: Understanding User-Agent Strings, and Best Practices for detecting the Internet Explorer version.

I’d like to provide a quick update to this topic for the Beta 2 preview version of IE7.

For the Beta 2 preview, we’ve removed the “b” from the user agent string.  We made this change early in order to help accommodate some sites which were mistakenly trying to cast the HTTPBrowserCapabilities.Version string property to a float. This cast throws an exception if the “b” is present in the string.  (For completeness, we’ve also updated the MSDN documentation for this property to help clarify that this property cannot be blindly cast to a number.)

With the removal of the “b”, most Internet sites are viewable in IE7, although there are a few sites which fail to recognize IE7 because they are performing exact string matches to look for specific IE version strings.  Those checks will need to be removed or updated to accommodate IE7.  The Best Practice document linked above provides suggestions.

If you need to be able to detect the IE7 beta version, you can still use conditional comments, because conditional comments do not evaluate the User-Agent header.  Instead, conditional comments are evaluated against IE’s Version Vector, which still contains the “b”. 

Hence, the following code will generate appropriate text, depending on whether or not the user is running a beta or final build:

          <!–[if IE 7.0b]>
          <p>Conditional comments indicate that you are using a beta version of Internet Explorer 7.0.</p>
          <![endif]–>

 

          <!–[if IE 7.0]>
          <p>Conditional comments indicate that you are using the final version of Internet Explorer 7.0.</p>
          <![endif]–>

You can use a simple User-Agent string test page to view your current user-agent string.  The page also provides simple registry scripts to override the user-agent string to help simulate different IE versions.

To summarize:

  • IE7 running on Windows Vista will send the following User-Agent header: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
  • IE7 running on Windows XP SP2 will send the following User-Agent header: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

Happy beta-testing!

 – Eric Lawrence

Comments (52)

  1. Tom says:

    Mmmmmmmmmmmmmm

  2. Bogtha says:

    Genuine question:

    If you provided an accurate User-Agent header (none of this Mozilla/4.0 crap), do you really think it will cause significant problems for *anybody* *anywhere*?

    I just get the feeling that you are too scared to make any unnecessary changes for fear that it might break for somebody somewhere, and are ignoring the fact that yours is the most widely-used browser, and so you can call the shots when it comes to introducing a bit of sanity like a real User-Agent header.

    Are your customers really clamouring for you to not break their fragile, buggy browser sniffing, or is it a phantom you are chasing?

  3. Dark Phoenix says:

    >If you provided an accurate User-Agent header (none of

    > this Mozilla/4.0 crap), do you really think it will

    > cause significant problems for *anybody* *anywhere*?

    Actually, that is an accurate User-Agent string. Watch:

    IE6

    Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

    Mozilla Firefox 1.5

    Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20060110 Debian/1.5.dfsg-4 Firefox/1.5

    Opera 8.5

    Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.51

    Konqueror 3.5

    Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11; en_US) KHTML/3.5.1 (like Gecko) (Debian)

  4. Sven Groot says:

    Agreed. Imho, the IE7 UA string should be something like this:

    MSIE/7.0 (Windows NT 6.0; other stuff)

    I don’t think this’ll break too many pages, after all, most sites (I think) do a index=UserAgent.IndexOf("MSIE") to see if it’s IE and then UserAgent.Substring(index +5, 3) to get the version, both of which will still work with this new UA. Only those that try to do more precise matching will fail.

    I think the real reason MS isn’t willing to change this is because it would break the browser detection of ASP.NET (all versions). I say screw that. Just put an ie7.browser (ASP.NET 2.0) and an updated browser section for machine.config/web.config (ASP.NET 1.1) on MSDN (preferably before release of IE7 final) and you should be covered.

    An additional question. My UA string here with IE7 is this:

    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    I thought the SV1 bit was going to be dropped?

  5. cooperpx says:

    Lots of code of varying languages, and various sources (ie: web applicances, asp.net, proxies) are outside of Microsoft’s control. It’d be 100% silly to change the way things are and potentially break stuff.

    — if there’s an argument to be had, it’s the extra bandwidth on every hit.

    For security and bandwidth concerns, I don’t see why it’s relevent to send the OS version, service pack and CLR runtime versions. This just broadcasts "hi eavesdroppers, I’m not fully patched ~ hurt me".

    Why not expose this type of information on demand via a method in the navigator object?

    ie:

    var bIsSupported = navigator.isSupported("{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"); // clsid, oid, shorthand, whatever

    var aSupportedCombo = naviagtor.supports(); // array of { tag: "{classid}", value: true/false }

    You could expose to javascript if: display via voice, word, excel, pdf, gzip, authorized ActiveX component, isgenuine, vml, ‘avalon’, etc, could be naitively handled in IE.

    I would imagine the list would be tailered based on the current Zone.

    ah, the lovely feature creep. Never would happen.

  6. treego says:

    Is there anyway to get the user agent string from IE6 back into IE7 Beta 2 for webpage compatibility’s sake until some webpage authors catch up to the IE7?

    For instance, my online tax prep site (TurboTax) does not allow me to complete my taxes online since I upgraded from IE6 to IE7 Beta 2.

    Thanks for any insights that can be provided for this.

  7. DMassy says:

    treego,

    There is a link at teh end of the blog post http://www.fiddlertool.com/useragent.aspx that allows you to do exactly that.

    Thanks

    -Dave Massy [MSFT]

  8. Sven Groot says:

    treego: You could use Fiddler (http://www.fiddlertool.com/fiddler/) and set up a script to replace the User-Agent header.

  9. Trevor says:

    Ha ha ha that’s funny!

    So, basically, MS can’t release IE7 before tax time (april), because it will break SW with the IE engine embedded.

    If there was ever a good reason why the Browser should NOT be part of the OS, here is your answer.

    That is hilarious, and scares me, because I bet it isn’t the only program.

    I guess I won’t be installing the Beta any time soon then.

    Sorry to sound mean, but as I try hard to defend IE, I keep hitting these catch-22 situations where the Browser locks you in to a time period, or OS to maintain functionality.

    Oddly enough, installing *any* other browser, doesn’t suffer from this issue.

    I like IE, but man, its hard to like the ugly duckling.

  10. mathbr says:

    »» If you provided an accurate User-Agent header (none of this Mozilla/4.0 crap), do you really think it will cause significant problems for *anybody* *anywhere*?

    »»

    »» Actually, that is an accurate User-Agent string. Watch:

    I agree with Bogtha. Why keep that useless Mozilla/4.0, compatible, whatsoever? Clients should not be detected by their name, but by their abilities. It is absolutely none of anyones business with what I am surfing, as long as it is able to handle his pages, scripts ans so on.

    It is pretty easy to query the abilities of clients in a lot of modern scripting languages

    Besides, this is my UA-string:

    »» Opera/9.00 (X11; Linux i686; U; de)

  11. EricLaw [MSFT] says:

    @Bogtha: "If you provided an accurate User-Agent header (none of this Mozilla/4.0 crap), do you really think it will cause significant problems for *anybody* *anywhere*?"

    Yes, I do, because I’ve tried it. You can write a simple rule using Fiddler to try out any string you’d like. You’ll find a HUGE number of sites break when the UA string changes.

    To be clear, it’s not that webdevs are demanding that we "not break their fragile, buggy browser sniffing" so much as it is that users are demanding that IE7 be able to view their web pages.

    @Sven: "I thought the SV1 bit was going to be dropped?"

    Yes. The SV1 bit is what’s called a "Post platform" token. We no longer set it, but if you upgrade from IE6 on XPSP2, the token lingers in the registry.

    @Trevor: "If there was ever a good reason why the Browser should NOT be part of the OS, here is your answer."

    I fail to see the point you’re trying to make. IE7 will be released when it’s done. This has nothing to do with being a part of the OS.

    As it stands, we are working with the TurboTax folks already and it’s likely that they’ll update their site soon.

    @Trevor: "Oddly enough, installing *any* other browser, doesn’t suffer from this issue."

    When I visit the TurboTax site in Firefox v1.0.5, I am blocked from the site with the message at http://www.turbotax.intuit.com/welcome/common/browser.htm.

  12. treego says:

    So, I need this extra program called Fiddler to Identify as IE6 when using IE7 Beta 2? Sorry, but this is a little hard for me to comprehend, it seems. Thanks for your help, again.

  13. EricLaw [MSFT] says:

    >When I visit the TurboTax site in Firefox v1.0.5

    Typo. Firefox v1.5.0.1 is what’s sending me to the error page.

  14. EricLaw [MSFT] says:

    @treego: "So, I need this extra program called Fiddler to Identify as IE6 when using IE7 Beta 2"

    Nope. You have two choices:

    1> Use Fiddler to rewrite your web traffic. It works, but it’s a sledgehammer.

    2> Simply run the .REG script provided at http://www.fiddlertool.com/useragent.aspx. This sets a registry key that overrides the user-agent that IE sends. No additional programs are needed.

  15. mathbr says:

    »» Yes, I do, because I’ve tried it. You can write a simple rule using Fiddler to try out any string you’d like. You’ll find a HUGE number of sites break when the UA string changes.

    And *that* is your explanation? Sorry, but this is ridiculous. When do you plan to drop the old useless browser-sniffing? Or are you happy with it?

    As I stated before, I can accept that my browser is not able to view any page because of its *abilities*, but I will not accept the same behaviour because I am using this browser.

    Please keep in mind that you are actually the only one who is able to initiate such a change because your software is the most used one.

  16. DMassy says:

    treego,

    If you actually follow the link that we referred you to at http://www.fiddlertool.com/useragent.aspx then at the bottom of the page you will find links to registry keys that will change the UA string. No need to install an extra program at all. Although I do have to say that Fiddler rocks!

    Thanks

    -Dave

  17. treego says:

    Is it possible to change the user agent string back to IE7 Beta 2 when I desire with a script, also, there? It seems that is what one of the options there says, but I’m not sure. Finally, will any upgrades of IE overwrite the UA string in the registry for me automaatically or do I have to manually keep up with that user agent string maintenance if I run a script now to change the user agent string?

    I think I’m done with my questions now. Thanks for the good and quick help.

    P.S. Turbotax works with Firefox 1.5.0.1 here, but I don’t like Firefox much at all.

  18. Rick says:

    @EricLaw

    visiting TurboTax with: "Firefox v1.0.5"???

    Please tell me that was a typo. 1.5 has been out for quite some time now.

  19. Trevor says:

    Uhm, TurboTax with Firefox 1.5x works just fine.

  20. Bogtha says:

    @EricLaw,

    > Yes, I do, because I’ve tried it. You can write a simple rule using Fiddler to try out any string you’d like. You’ll find a HUGE number of sites break when the UA string changes.

    Sorry, you’ve missed my point. Your experiment assumes that web developers will do nothing whatsoever when faced with these errors. After all, when it’s just you with that UA string, why would they? But when loads of their visitors start upgrading, they’ll sit up and take notice straight away.

    I think it’s fair to say that if you made a post on this weblog regarding the matter and shipped the next beta with a new UA string, then *a hell of a lot* of developers will fix the problem very quickly.

    That was kind of the point of my first comment. If you went ahead and made the change, then a week after Internet Explorer 7.0 Final is released, how many websites do you expect to be broken in this way? I believe it will be a small minority, and your experiment doesn’t contradict that in any way. Do you disagree? I’m genuinely interested in hearing reasons why this might not happen, but your experiment merely shows the state of play *today*, and not the consequences of you fixing your UA string.

    It’s a similar situation as to when you fixed up your media type sniffing with Windows XP Service Pack 2. You mentioned it here, you published a document telling web developers what the deal was, and you went ahead and made the change. How many websites rely on the pre-SP2 sniffing and break with the post-SP2 sniffing today? And that can be a relatively obscure change. With sniffing, it’s immediately in your face, so any affected web developer is going to have an immediate "oh hell I need to fix this ASAP" moment.

  21. Dark Phoenix says:

    > Why keep that useless Mozilla/4.0, compatible, whatsoever?

    Historical reasons. Plus that’s the only way to tell the different between Internet Explorer and old Netscape Navigator 4.x.

  22. mathbr says:

    »» Why keep that useless Mozilla/4.0, compatible, whatsoever?

    »»

    »» Historical reasons.

    And what in particular should keep browser-developers from changing the way the ua-string is built up?

    »» Plus that’s the only way to tell the different between Internet Explorer and old Netscape Navigator 4.x.

    And what has this to do with the coming version of IE, Firefox and so on? Old clients will still keep their ua-strings, but why should this prevent a new ua-string?

    I don’t get your point.

  23. Dao says:

    Shouldn’t it be WIE for Windows Internet Explorer? :)

  24. PatriotB says:

    Bogtha, read Eric’s words again:

    "To be clear, it’s not that webdevs are demanding that we "not break their fragile, buggy browser sniffing" so much as it is that users are demanding that IE7 be able to view their web pages."

    Think of the ordinary users. They install new IE 7, and suddenly a whole lot of web sites are messed up? That’s not a good experience; MS will get blamed, and then people don’t want to upgrade.

    Yes, there are many web developers who would jump on it and fix their sites. But many wouldn’t, and that would have a negative effect on IE’s end users.

    That said, I personally wouldn’t mind seeing the UA get changed to MSIE/7.0 (…) but I can understand why the team doesn’t want to make the change: it would have zero positive impact on the end user.

  25. ieblog says:

    In support of PatriotB’s point above. The problem is that rightly or wrongly millions of websites expect to see the user agent string today in its current format, a format that goes back to the earliest browsers. I’m sure someone has some history on when exactly it first appeared. Many of those sites have minimal maintenance available for them and will not be readily updated to accept a new format UA string. If at release most websites do not work with IE7 then this will block adoption of the browser. It’s easy to say that those websites should be updated and it should be really easy for them to do so but we should remember that for many businesses that is an unacceptable cost that has been forced on them and may involve bringing in a consultant who charges them time by the hour. The change may not even be that simple if the system has not been well maintained and managed.

    Users who are not technically savvy such as some members of my family will install the new browser and say to themselves "it doesn’t work" because many websites will appear broken. They will then uninstall the new version of the browser and tell their friends it doesn’t work. It doesn’t make any difference that it is the site’s fault and not the browser, as far as the user is concerned IE7 is broken and they will refuse to install it.

    The ability to browse existing content without modification is essential to any browser if it is to gain adoption amongst the typical user or the user will consider it the fault of the new browser. From some perspectives they may be correct and it is simply the browser’s responsibility to render existing content.

    We really appreciate all the feedback on this preview release of beta 2 of IE7. The feedback helps us prioritise work so we can deliver a great final product.

    Thanks

    -Dave Massy [MSFT]

  26. mathbr says:

    I do understand your point. If the IE7 really does understand additional webstandards I would be very happy to see it spread and replacing old versions.

    Sometimes it is like fighting windmills …

  27. treego says:

    Well, I ran the script to Identify as IE6 while using IE7 Beta 2 and it now allows me to finish my taxes with TurboTax. That’s nice, indeed.

    Now, if I want to go back to the default user agent string for IE7 Beta 2, how do I do that? Do I have to wait for the next update of IE7? Will the next update of IE7 override any of these registry modifications for the user agent string?

    Thank you.

  28. Robert says:

    I suggest that you give IE7 two UAs. The current one could be set as default. But, you could have the option for power users to switch to a more appropriate one, such as MSIE/7.0 or something. This would let developers prepare for the new UA, without breaking the net for everyone else. You could then drop the classic UA with IE8 or 9.

  29. treego,

    To get back to the IE7 user agent string simply run the reg key at the bottom of the page at http://www.fiddlertool.com/useragent.aspx entitled "Internet Explorer 7 Beta 2 & RTM".

    Thanks

    -Dave

  30. treego says:

    Thanks, Dave. That seemed logical, but I didn’t know what the "RTM" meant.

  31. Eric Lunt says:

    Thank you for the clarification. Quick question: is there any way to distinguish between an automated RSS poll of a resource from an explicit page visit by the user? I’d like to be able to tell the difference via the User-Agent header instead of having to rely on the presence of a Referrer header, for instance.

    Thanks!

  32. catch 22 says:

    -Dave Massy [MSFT]

    "It doesn’t make any difference that it is the site’s fault and not the browser, as far as the user is concerned IE7 is broken and they will refuse to install it. "

    Imagine if IE7 was not part of the OS and it could be installed right alongside IE6. Then grandma could switch back to the old browser, just for those broken sites, but still have the whizbang IE7 available for all those WEB 2.0 sites.

    Nah! Never mind, it’s a stupid idea. Other browsers did that, and look how miserably they failed.

  33. kjh says:

    <i>Imagine if IE7 was not part of the OS and it could be installed right alongside IE6. Then grandma could switch back to the old browser, just for those broken sites, but still have the whizbang IE7 available for all those WEB 2.0 sites. </i>

    So you expect that:

    a) an entirely new side-by-side browser technology be developed, and

    b) "grandma" be expected to learn and understand how to use it

    all to solve an unnecessary versioning problem created by making aesthetic changes to a string whose format has been fixed for years and the end-user never, ever, ever sees?

    Are you people monkeys?

  34. alexander says:

    I cant see where this urge (to satisfy every single webmaster when it comes to the user-agent string) comes from.

    You dont care anything about people writing css/xhtml/javascript, why would you have such a deep love for the few who use oldfashioned user-agent string identification?

    Besides its really a shame to call your browser with the name mozilla, because yours isn’t anywhere close.

  35. LinWinOverlord says:

    If you even took the opportunity to notice, IE7 is separated. In XPSP2, IE7 has no capability to read C: in the address bar. It forces the Windows shell to open up…. Wait, if it calls the Windows shell and it looks "webby", then that means they are trying to trick us! M$ still left the browser completely tied to the OS. What would be great is if the Vista team integrated a separate engine into Windows that allowed the weblike content of Windows Explorer to still function even without IE installed at all. And perhaps, Microsoft will provide a patch that replaces the Windows shell program of Windows 95, 98, ME, NT, 2000, and XP to work with this new internal engine…. Vista could have it already included. That would solve the problem of IE being so closely integrated into Windows Vista without sacrificing *any* functionality! WOW! I MUST BE BRILLIANT!!!

  36. RS says:

    This is OK except Beta 2 Preview has a least one serious bugs (like multiple submissions of POST data…which has been reported elsewhere) that has cause us to actively disable IE 7.0 from accessing our website until it is fixed.

    That means that when this problem is fixed we need to have a new version number so that we can explicitly never allow people with Beta 2 preview to access our site. I am sure that may other sites will have the same issue.

  37. Mark says:

    "Beta 2 Preview has a least one serious bugs (like multiple submissions of POST data…which has been reported elsewhere) that has cause us to actively disable IE 7.0 from accessing our website until it is fixed."

    Wouldn’t it be simpler to just make your site robust in the face of undesired retransmissions?  These also happen when the user hits REFRESH and accepts the prompt to retransmit.

    Just add a nonce to your original form, and if you get a duplicate nonce, ignore the reposting.

    This is how Amazon and other big ecommerce sites prevent duplicate orders.

  38. Client Helpdesk says:

    I would like to request that future updates to IE7 increment the version number instead of adding additional tokens like "SV1" or "Q312461". It would have been much easier (for users and developers alike) to refer to "MSIE 6.2" instead of "MSIE 6.0 with XP Service Pack 2 installed."

  39. Ian Thomas says:

    What about something like:

    MSIE/7.0 (compatible; MSIE 7.0; Windows NT 6.0)

    Thats a step on the way to being logical, but shouldn’t break too much browser sniffing (absolutly no reason I can see for them looking for Mozilla/4.0)

  40. Brian says:

    I agree with the many very bright folks here, I would rather my user-agent be kept anal-retentively pure than be able to visit most of the web sites I rely on for paying utility bills, making share trades, buying stuff, or performing other totally purposeless activity.

    It’s a sensible priority.

  41. Dark Phoenix says:

    > Besides its really a shame to call your

    > browser with the name mozilla, because yours

    > isn’t anywhere close.

    Has absolutely nothing to do with the Mozilla browser.  The Mozilla prefix became standard part of the UserAgent string back when Netscape Navigator was the dominant browser, and people coded Javascript expecting the UserAgent to start with Mozilla/versionnumber.

  42. Eric K. says:

    I don’t normally typie in all upper-case, but HOW DO YOU GET RID OF THE BOX IN THE UPPER RIGHT CORNER OF RSS FEEDS!?!  

    It obscures content, stays in place no matter what you do, and has no apparent mechanism for GETTING IT OUT OF MY WAY.

    Thank you, and good night.

  43. IE7/RSS Platform – User-agent 文字列

  44. IEBlog says:

    With the release of Windows Vista Beta 2, I want to announce that we will be naming the version of IE7…

  45. IE7/RSS Platform – User-agent 文字列