views:

161

answers:

2

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.

Now I put the answere in doubt again, in a machine with IE8 that same executable is being identified as IE7 by the server. I wrote a simple rails app that pirnts the user agent and it is clear. In the same machine if I access this rails app in IE it prints:

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.

Now the things get a little more strange. If I go to system32/ieframe.dll and check the version... 8.0.

I´m really confused. The question is: When I use TWebBrowser, wich version of ie will be used, indeed?

Thanks.

A: 

Maybe TWebBrowser saves the Useragent it had at the time of creation in ControlData property? Try deleting and re-adding the control to the form on a computer with IE8.0 installed.

At any case, those User agent strings looks oddly similar. It's probably the same IE8.0 engine, no matter what it prints.

himself
+6  A: 

It's using IE8, but in IE7 compatibility mode. 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.

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.

Michael Madsen
IE9 uses new constants (9000 and 9999) with meanings akin to the IE8 constants (8000 and 8888)
EricLaw -MSFT-
@EricLaw: Out of curiosity, do you know if any of those values can be used to mean "newest"? I.e., IE8 rendering if the user has IE8 and IE9 rendering if the user has IE9?
Michael Madsen
Excellent question; I asked the owners the other day and didn't hear back. Shoot me mail (ericlaw @ microsoft) and I'll ensure to get back to you (and here!).
EricLaw -MSFT-