简体   繁体   English

TWebBrowser和IE版本

[英]TWebBrowser and IE version

When I asked this question I accepted the answere because it made sense and the documentation pointed was right. 当我问这个问题时,我接受了回答 ,因为它是合理的,并且所指向的文档是正确的。

Testing a machine with IE6 against other one with IE7 with the same compiled executable using TWebBrowser the behaviour was indeed as pointed in the answere. 使用TWebBrowser将具有IE6的计算机与具有相同编译可执行文件的IE7的计算机进行测试,其行为确实如答案中所指出的。

Now I put the answere in doubt again, in a machine with IE8 that same executable is being identified as IE7 by the server. 现在,我再次对受质疑者表示怀疑,在一台装有IE8的计算机中,该服务器将同一可执行文件标识为IE7。 I wrote a simple rails app that pirnts the user agent and it is clear. 我编写了一个简单的Rails应用程序,可以清晰地显示用户代理。 In the same machine if I access this rails app in IE it prints: 在同一台机器上,如果我在IE中访问此rails应用程序,它将打印:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.5; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729)

When I access using that executable: 当我使用该可执行文件访问时:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; GTB6.5; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729)

Furthermore, with a little help from my friend Process Monitor I realized that the classid called to instantiate the TWebBrowser is {8856F961-340A-11D0-A96B-00C04FD705A2} wich in windows registry has the name "Microsoft Web Browser" and points to ieframe.dll. 此外,在我的朋友Process Monitor的一点帮助下,我意识到调用实例化TWebBrowser的classid是{8856F961-340A-11D0-A96B-00C04FD705A2},该文件夹在Windows注册表中的名称为“ Microsoft Web Browser”,并指向ieframe。 dll。

Now the things get a little more strange. 现在事情变得有些奇怪了。 If I go to system32/ieframe.dll and check the version... 8.0. 如果我转到system32 / ieframe.dll并检查版本... 8.0。

I´m really confused. 我真的很困惑。 The question is: When I use TWebBrowser, wich version of ie will be used, indeed? 问题是:当我使用TWebBrowser时,确实会使用ie的最全版本?

Thanks. 谢谢。

It's using IE8, but in IE7 compatibility mode. 它使用的是IE8,但处于IE7兼容模式。 The IE team blogged about this back in March 2009, where they also described how you can get IE8 rendering instead of the IE7 default. IE小组在 2009年3月就此发表了博客 ,他们还描述了如何获取IE8渲染而不是默认的IE7。

I haven't seen anything about how IE9 will behave here, so I can't say if you'll need a different value to use IE9 rendering, or if there's some other value which simply means "newest" and gets IE8 rendering as well. 我还没有看到有关IE9在这里的行为的任何信息,所以我不能说您是否需要一个不同的值来使用IE9渲染,或者是否还有其他值只是意味着“最新”并获得IE8渲染。

Maybe TWebBrowser saves the Useragent it had at the time of creation in ControlData property? 也许TWebBrowser将创建时的Useragent保存在ControlData属性中? Try deleting and re-adding the control to the form on a computer with IE8.0 installed. 尝试删除该控件并将其重新添加到安装了IE8.0的计算机上的表单中。

At any case, those User agent strings looks oddly similar. 无论如何,这些用户代理字符串看起来很奇怪。 It's probably the same IE8.0 engine, no matter what it prints. 无论打印什么,它都可能是相同的IE8.0引擎。

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

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