Internet Explorer 10 user-agent string
The Internet Explorer 10 user-agent string has been updated to reflect the new browser. As a result, websites that use browser detection might not work correctly when attempting to parse the Internet Explorer 10 user-agent string.
Symptom
Many websites attempt to identify the browser by parsing the user-agent string to serve specific content to specific browsers. Poor implementations of this technique (also known as browser detection or user-agent sniffing) might not correctly parse the Internet Explorer 10 user-agent string:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)
Overall, this represents a natural evolution of the Windows Internet Explorer 9 user-agent string with the following changes:
- The value of the Version token ("MSIE") is now "10.0".
- The value of the Trident token ("Trident") is now "6.0".
- On Windows 8, the value of the Platform token ("Windows NT") token is now "6.2".
When a webpage is displayed in Compatibility View, Internet Explorer 10 displays the page in IE7 Standards mode, which is consistent with the behavior of Internet Explorer 9 and Windows Internet Explorer 8. This also affects the user-agent string:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Trident/6.0)
The user-agent string is similar to the one reported by Windows Internet Explorer 7, however, the Trident token is set to "6.0," which identifies Internet Explorer 10.
The change to the Version token ("10.0") is particularly noteworthy because an extra digit has been added to the string. Sites that use effective browser detection should handle this change seamlessly, however, implementation that rely on specific string patterns might process the extra digit incorrectly, possibly causing them to identify Internet Explorer 10 as "IE1".
To illustrate, the following regular expression captures only the first digit of the Version token:
// INCORRECT: will report IE10 version in capture 1 as "1" var matchIE = /MSIE\s(\d)/;
Resolution
The best solution is to use feature detection, rather than browser detection. However, if you simply need to update your existing user-agent string detection to account for Internet Explorer 10, here’s a regular expression that captures the full value of the Version token:
// CORRECT: will report IE10 version as "10" var matchIE = /MSIE\s([\d]+)/;
Your code might look significantly different, depending on the programming language, the technique used to parse the user-agent string, and so on.
If your site uses custom HTTPS configurations with Apache, you might need to update your configuration to account for the Internet Explorer 10 user-agent string. For more info, see IEInternals: HTTPS and Keep-Alive Connections.
Related topics
- How to detect features Instead of browsers
- ASP.NET fails to detect Internet Explorer 10
- Detecting Internet Explorer more effectively
- Internet Explorer 10 Compatibility Cookbook
Build date: 6/12/2013
