Using it as a CDHTMLDialog from MFC, I noticed that for some sites (such as wikipedia.org) the embeded IE reports a documentMode
property of 7, while using the IE app properly presents the documentMode
property as 8. Same thing is true for IE11 too (documentMode
property is 11 when launched standalone and 7 when used embedded). What's going on here ?
Asked
Active
Viewed 921 times
0

Lance Leonard
- 3,285
- 3
- 16
- 15

kellogs
- 2,837
- 3
- 38
- 51
-
1The WebBrowser control is handled differently than native IE. Use the BROWSER_EMULATION feature control key to set the default to your preference; see https://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulation and http://stackoverflow.com/questions/646742/how-to-programmatically-turn-off-quirks-mode-in-ie8-webbrowser-control for more info. – Lance Leonard Jul 05 '15 at 04:43
-
@LanceLeonard That was it! – kellogs Jul 05 '15 at 10:01
1 Answers
0
IE’s Compatibility View Settings determine precedence of how the site is rendered . By default these settings force all intranet sites into Compatibility View regardless of DOCTYPE
. You can use X-UA-Compatible
which overrides the Compatibility View Settings, so the page will render in standards mode regardless of the browser settings.
The X-UA-Compatible
meta tag allows you to set which version of Internet Explorer the page should be rendered as. For example, using IE=Edge
tell the browsers to render the latest.
<meta http-equiv="X-UA-Compatible" content="IE=edge">

Rami Sarieddine
- 5,396
- 35
- 41
-
2Your answer is correct when applied to webpages loaded by IE directly, however, it fails to account for the default differences between IE and applications hosting the webbrowser control. (These differences exist because it is assumed that applications have compatibility requirements different from the browser.) Please see the links in my earlier comment for more information. – Lance Leonard Jul 06 '15 at 19:57