IE11 User-Agent string

Windows 8.1 comes with the new Internet Explorer 11 which sends the following User-Agent string in the HTTP requests to the webservers:

Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko

To see what’s the point here, compare this with the old versions’ UA strings:

Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)

The format completely changed, what’s more the MSIE token is completely removed! This change may cause issues, if your code contains browser-specific parts, because your old code probably won’t recognize the new browser.

Even the ASP.NET platform contains codes which respect the client’s browser, and unfortunately there were some issues in the past when some features didn’t work well with the new browsers.

Thankfully the browser detection feature of ASP.NET is completely customizable with .browser files, and if you check the C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers\ie.browser file on Windows 8.1, you will see that it already contains a section for IE11:

<browser id="InternetExplorer" parentID="Mozilla">
   <identification>
     <userAgent match="Trident/(?'layoutVersion'[7-9]|0*[1-9]\d+)(\.\d+)?;(.*;)?\s*rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)))" />
     <userAgent nonMatch="IEMobile" />
     <userAgent nonMatch="MSIE " />
   </identification>
   <capabilities>
     <capability name="browser"              value="InternetExplorer" />
     <capability name="version"              value="${version}" />
     <capability name="majorversion"         value="${major}" />
     <capability name="minorversion"         value="${minor}" />
     <capability name="layoutEngine"         value="Trident" />
     <capability name="layoutEngineVersion"  value="${layoutVersion}" />
     <capability name="type"                 value="InternetExplorer${major}" />
   </capabilities>
</browser>

My personal experience is that old web applications must be thoroughly tested with the new IE11, even if you didn’t write any browser-dependent code, because the platform you rely on may also contain such logic. You must be especially careful if you run ASP.NET 4.0 on the server (probably because you cannot do the in-place upgrade to 4.5).

In a next post I will write about some issues we saw while we tested our ASP.NET apps with IE11.

 

Technorati-címkék: ,,

1 thought on “IE11 User-Agent string

  1. Pingback: ASP.NET 4.0 forms authentication issues with IE11 | Codes from the field

Leave a comment