IWebBrowser2对象使用IE7版本,而不是机器上安装的IE版本
我正在使用 IE8 浏览器的 Win7 机器上进行开发(IE9 上也会发生同样的情况)。
我创建了一个应用程序,其中嵌入了本机窗口中的 IWebBrowser2 对象。
在该浏览器对象中,我执行 javascipt 代码:
var txt = "Browser Name: " + navigator.appName + "\n";
txt += "Browser Version: " + navigator.appVersion + "\n";
alert(txt);
并且收到以下警报:
这证实了我之前的担忧- 即使我的机器上安装了 IE8\IE9 - IWebBrowser2 对象的行为就好像它是 IE7 (包括所有烦人的 HTML\CSS 行为)。
有谁知道这是为什么?或更好 - 如果有可能将浏览器对象嵌入为 IE8\IE9 (用于分发 - 所以它应该是合法的)
谢谢,
I'm developing on a Win7 machine with IE8 browser (same thing occurs also on IE9).
I've create an application with an IWebBrowser2 object embedded within a native window.
Within that browser object i execute a javascipt code:
var txt = "Browser Name: " + navigator.appName + "\n";
txt += "Browser Version: " + navigator.appVersion + "\n";
alert(txt);
and i receive the following alert:
That confirmed my earlier worries - even when having IE8\IE9 installed on my machine - the IWebBrowser2 object behaves as if it was IE7 (including all of the annoying HTML\CSS behaviors).
Does anyone know why this is? or better - if there is any possibility to embed a browser object as IE8\IE9 (for distribution - so it should be legal)
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IE7 是嵌入式 IE 控件的默认呈现模式(出于兼容性原因)。使用 FEATURE_BROWSER_EMULATION 注册表项改变这一点。
阅读Plip 的回答 或 IEBlog 了解如何执行此操作。
IE7 is the default rendering mode for embedded IE controls (for compatibility reasons). Use the FEATURE_BROWSER_EMULATION registry key to change that.
Read Plip's answer over here or IEBlog to get an idea how to do this.