WebBrowser Control Rendering Modes in IE8

 

Note: The feature control key and mode information in this post is now outdated. Please refer to the updated post on this topic: https://blogs.msdn.com/ie/archive/2009/03/10/more-ie8-extensibility-improvements.aspx  

 

Many commonly used applications and Windows system components depend on the MSIE WebBrowser control to render webpages from within their program. Unlike live sites, pages loaded within these controls are typically static resources stored in libraries and executables on a system. While webmasters can easily alter their site to render properly in the new version of IE, many software vendors do not have the resources to instantly push out new versions of their applications with updated internal pages. In order to ensure that these existing applications remain in working order, IE8 renders pages running within instances of the WebBrowser control in IE7 Standards Mode by default.

Per-Application WebBrowser Control Rendering Settings

MSIE 7.0 UAS Test Screen

The test container shown above uses the IE7 Standards Mode run by default within WebBrowser control containers. While this mode works well with existing applications, developers building new applications may want to use the new IE8 Standards rendering mode as shown below.

MSIE 8.0 UAS Test Screen

When an executable loads an instance of the WebBrowser control it scans the registry to check whether the executable wants IE7 Standards or IE8 Standards mode.

To run a WebBrowser control in IE7 Standards Mode, insert the following values into the registry:

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_NATIVE_DOCUMENT_MODE]

"MyApplication.exe"=dword:11170

To run in IE8 Standards Mode insert the following registry value:

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_NATIVE_DOCUMENT_MODE]

"MyApplication.exe"=dword:13880

In both of these instances, MyApplication.exe should be replaced with the name of the executable that will be running WebBrowser controls in a specified mode.

User-Agent String and WebBrowser Quirks Mode Rendering Issues

MSIE 5.0 Quirks UAS Test Screen

Specification of an IE rendering mode also applies to IE5 Quirks Mode. To run instances of a WebBrowser control in IE5 Quirks Mode, insert the following value into the registry:

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_NATIVE_DOCUMENT_MODE]

"MyApplication.exe"=dword:C350

Due to a known bug in the IE8 Beta 1 build, the User-Agent String returned by the browser instance will state that it is “MSIE 8.0” (as shown in the screenshot above). Knowledge Base Article 183412 provides a workaround for this scenario.

IE Version Targeting and WebBrowser Rendering Modes

MSIE 7.0 Version Target UAS Test Screen

As with webpages displayed in an IE window, pages hosted in a WebBrowser control can also override rendering settings by using the X-UA-Compatible meta tag to specify a rendering mode. For more information on formatting and values for the version targeting META tag see Scott Dickens’ latest post here.

Matthew David Crowley
Program Manager
Internet Explorer Extensibility

Note: The feature control key and mode information in this post is now outdated. Please refer to the updated post on this topic: https://blogs.msdn.com/ie/archive/2009/03/10/more-ie8-extensibility-improvements.aspx