The Internet Explorer 8 User-Agent String
As Dean announced, a beta version of Internet Explorer 8 will be released in the first half of 2008.
The HTTP headers of every web request contain a simple string called the "User-Agent" that allows servers to identify the type and version of the visitor’s browser. For a deeper understanding of the User-Agent string, please see Understanding User-Agent Strings.
When released, the IE8 beta will introduce an updated User-Agent string. For IE8, we’ve simply replaced "MSIE 7.0" with "MSIE 8.0". For example, on Windows Vista, IE8 sends:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)
Websites that are sensitive to changes in the User-Agent string may need to be updated to support IE8.
During internal testing, we have encountered a small number of sites which fail to recognize IE8 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 IE8. The article Best Practices for detecting the Internet Explorer version provides suggestions and code samples.
As noted in the Best Practices article, it is not recommended that you block access to content based on the user-agent string of the browser. If you do have to offer different content to different versions of the browser due to improved capabilities, you should ensure that future versions of the browser are not blocked. Serving content based solely on the user-agent string is often an unreliable way to detect the full capabilities of the browser, because the user might have adjusted some settings, such as disabling script or extensions.
Detecting Beta Versions
For IE7 beta, a "b" was added to the User-Agent string
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0
... to identify the browser as a beta release. While this was consistent with prior IE releases, it caused many site compatibility problems. Server code tried to cast the string between MSIE and the next semicolon into a floating point number, and failed when the "b" was encountered.
To prevent similar problems in the IE8 beta, we will not include the "b" in the IE8 beta User-Agent string. Pages can detect if they are running inside a beta version using the following script:
if ((null != window.navigator.appMinorVersion) &&
window.alert("This is a beta browser.")
window.alert("This is NOT a beta browser.");
If you’d like to see how your sites react to the new IE8 User-Agent string today, you can use the existing registry-based User-Agent override mechanism to cause IE7 to masquerade as Internet Explorer 8.
For the convenience of beta users, a new menu option is available in beta versions that will enable the IE8 beta to masquerade as IE7 without restarting. When the “Report IE7 User-Agent string” option is checked, IE8 will send the IE7 User-Agent to allow beta users to interact with any sites that have not yet updated to support IE8.