简体   繁体   English

IWebBrowser2对象使用IE7版本,而不是计算机上安装的IE版本

[英]IWebBrowser2 object uses IE7 version, instead of the IE version installed on the machine

I'm developing on a Win7 machine with IE8 browser (same thing occurs also on IE9). 我正在使用IE8浏览器的Win7机器上进行开发(在IE9上也发生了同样的事情)。

I've create an application with an IWebBrowser2 object embedded within a native window. 我已经创建了一个将IWebBrowser2对象嵌入本机窗口中的应用程序。
Within that browser object i execute a javascipt code: 在该浏览器对象中,我执行一个Javascipt代码:

  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). 这证实了我先前的担心-即使在我的计算机上安装了IE8 \\ IE9时-IWebBrowser2对象的行为也好像是IE7 (包括所有烦人的HTML \\ CSS行为)一样。

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) 或更好-如果有可能将浏览器对象嵌入为IE8 \\ IE9(用于分发-因此应该合法)

Thanks, 谢谢,

IE7 is the default rendering mode for embedded IE controls (for compatibility reasons). IE7是嵌入式IE控件的默认呈现模式(出于兼容性原因)。 Use the FEATURE_BROWSER_EMULATION registry key to change that. 使用FEATURE_BROWSER_EMULATION注册表项来更改它。

Read Plip's answer over here or IEBlog to get an idea how to do this. 在此处阅读Plip的答案IEBlog ,以了解如何执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM