Question

From this article Interoperable HTML5 Quirks Mode in IE10, the HTML5-based quirks mode is the default quirks mode in IE10 for those pages without a DOCTYPE or X-UA-Compatible tag. IE's legacy quirks mode is now referred to as Internet Explorer 5 quirks.

In the official IE10, it is. But not in the WebBrowser control. The default quirks mode is IE5 quirks in the WebBrowser control application.

For example: for a simplest html page that without DOCTYPE or X-UA-Compatible tag:

<html>
<head>
<meta charset="UTF-8" />
<title>Get documentMode!</title>
</head>
<body>
<h2>document.documentMode</h2>
<p>
<script>
document.write(document.documentMode);
</script>
<p>
</body>
</html>

The documentMode = 10 in Official IE10, but the documentMode = 5 in WebBrowser control application ( before test, I have added the registry item value: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\MyApp.exe to 10000, or 10001 in decimal).

Why the behavior is different?

How can I configure the default quirks mode of WebBrowser control application to "HTML5-based quirks mode" ?

Thanks for your reply in advance.

Was it helpful?

Solution

If you want to IE10 web browser control to show page without doctype, you need to set both of the following registry keys to make it work.

Key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
Value: yourappname.exe
Type: (DWORD_32Bit value)
Data: 0x2711

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_USE_QME_FOR_TOPLEVEL_DOCS
Value: yourappname.exe
Type: REG_DWORD (DWORD_32Bit value)
Data: 1

OTHER TIPS

To force documents to display in IE10 standards mode in a web browser control (irrespective of DOCTYPE), the DWORD value of the registry key HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\MyApp.exe (where MyApp.exe is the name of your application's exe file) should be 0x2711.

If that is not working for you, I would suggest using a tool like regmon to confirm that it is reading your application's registry key.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top