TWebBrowser and IE version - windows

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.

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.

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.

Related

Same IE version sending different user agent values from two different machines

I have seen similar questions in SO but they don't exactly point to the same problem I am facing.
I have two different desktops with same OS (Windows 8) and same version of IE (11.0.9600).
I am trying to connect to the same URL from these two desktops.
However, I notice that two different user-agent values are being submitted from these two IEs.
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko
and
User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; Touch; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; Tablet PC 2.0)
Can someone please help me understand how do I figure out the reason for this?
This issue has implication for me as the portal I am trying to access does not allow the first user-agent value and shows "unsupported browser" message.
Look at the User-Agent, in the second you have "compatible".
This compatible mode on F12 and its run with Explorer 10 user agent.
You are in the compatibility mode in the second instance.As IE is installed along with your windows, it may have been configured automatically in that mode.

IE8 reporting its user agent string as IE9

I've got a curious problem with a friend's computer. Although I've verified he's using Internet Explorer 8.0.6001.18702 on Windows XP (up to date with all things from Microsoft Update).
However, here is the user agent string it reports:
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C)
This is bizarre for a number of reasons:
IE8 is reporting that it's IE9. The Trident/4.0 definitely verifies that it's IE8. This is referenced by the official Microsoft documentation on the user agent string: http://msdn.microsoft.com/en-us/library/windows/desktop/ms537503(v=vs.85).aspx
I've only ever seen Mozilla/5.0 in the user agent string for actual versions of IE9.
I'm stumped. We've done a reset of IE (KB923737 at http://support.microsoft.com/kb/923737), I've disabled all extensions/addons inside IE, and there doesn't seem to be anything installed that would be purposefully altering the user agent string. I've also dug into the registry to see if the user agent string is being spoofed, and it is at the default (unaltered).
Anyone have any ideas of what I should look at or try next...or what might be responsible for IE8's apparent identity crisis?
We had a customer with the same issue. Also stumped. We changed to using TRIDENT as well as the MSIE number to accurately detect what they were using.
If they are using Trident 4, it is either IE 8 (or IE 7 because of compat mode) but nothing higher. Same for other versions of IE as well. Trident 5 can't be higher than IE 9, etc.

"var f = new ActiveXObject('Scripting.FileSystemObject');" not working with IE8

I am very new in using ActiveX controll through java script,
I write var f = new ActiveXObject('Scripting.FileSystemObject'); in my code and Its was working fine on IE6, but recently I upgraded my IE6 to IE8 and what I found now its not working on IE8, returning the error given below:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8;
.NET4.0C; .NET4.0E; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Wed, 31 Aug 2011 14:23:40 UTC
Message: Automation server can't create object
Line: 735
Char: 9
Code: 0
URI: http://localhost:8080/
qocweb/script/main/MainLetter.js
I googled this and found there is something missing in the IE ActiveX setting and got resolved this problem,
But now I have a requirement that it should be solved without playing with IE8 setting.
Can anyone have any idea about this, any suggestion would be really appreciable...
You can not use this component with default security settings due to security reasons. Read this for more information.

IE8 .net 4.0 IIS6 "Ajax client-side framework failed to load"

I just upgrated from VS2005 to VS2010 and works fine except for the following error on IE8 only:
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0;
.NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR
2.0.50727; yie8) Timestamp: Tue, 16 Aug 2011 18:46:04 UTC
Message: ASP.NET Ajax client-side framework failed to load.
Line: 130
Char: 34
Code: 0
URI: http://...
Message: 'Sys' is undefined
Line: 15
Char: 1
Seems like the the ScriptResource.axd js is not loaded correctly most of the time on this browser.
I've researched a lot about this kind of error and tried several things without luck. The wreird thing is that it's happenning just on IE8. Chrome and Firefox work fine.
It also works fine sometimes on IE8 :S
I din't find a conventional solution for this problem.
After debugging it I noticed that the problem was that the ajax script resources where loading after some other scripts.
I was not able to move the sripts up in the page because the application is very old and it wasn't even using master page, so I was limited on that.
I researched about the script manager and I found a new property on asp.net 4.0 called EnableCdn that basically, if it's set to "true", it loads the resources from the Microsoft content resource servers. Doing that those scripts loads quicker and the errors disappeared.
I hope this experience be useful for someone else.
Thanks!

Determining IE8's Document Mode diagram is wrong, or am I missing something?

I'm kind of lost with how IE8 determines the document mode. I got contradictions.
Setup
This is what a generated web page header looks like on my website, please note the doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head">
<meta id="IE8" http-equiv="X-UA-Compatible" content="IE=8" />
...
I'm using the meta http-equiv setted to X-UA-Compatible to force it to render in "standard mode", because this website has been made so. The website is on another machine in the company LAN (10.1.x.x).
Everything is ok up to now, but I'm having difficulties with the compatibility settings window:
Results:
When nothing is checked and listed in compatibility settings, user agent is:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [ok]
When only "Display all websites in Compatibility View" is checked:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [coherent but not expected]
When only "Display intranet sites in Compatibility View" is checked:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [not ok]
When the URL is added to the list of "Websites you've added to Compatibility View":
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) [coherent but not expected]
According to the following IE blog entry diagram, if the meta tag X-UA-Compatible is present and value is IE=8, the renderer is setted to "Standards mode".
As just described, that is not the case. Meta was always IE=8 but the user agent changed.
The diagram takes care of the compatibility view settings after the X-UA-Compatible meta check. In my case, it looks like the opposite.
Is the diagram wrong?
Questions:
Why the user agent is msie 8.0 when "Display intranet sites in Compatibility View" is checked?! (is it because of my meta? Is http://10.1.x.x/ really considered as an intranet website?)
Why the user agent is msie 7.0 when "Display all websites in Compatibility View" is checked??? (this override my meta ? but not according to diagram)
Why the user agent is msie 7.0 when the site is added to the compatibility list ?
According to the diagram, my doctype falls in the "Almost Standards Mode" category.
Seems there's a better meta to force IE8 standard mode, but according to the doctype:
<meta id="IE8" http-equiv="X-UA-Compatible" content="**IE=EmulateIE8**" />
Is it better to use it, or the one I'm currently using (force IE=8)?
Seems Almost Standards Mode is exactly the Standard Mode with a subtle change for the rendering of images in a table, ok but... which one should I pick?
Then again the diagram mention "IE=Emulate8" but this article talks about "IE=EmulateIE8", seems like the later is the correct version according to the documentation of http-equiv.
Is there a way to detect (client side/network) if IE is in "Almost Standards Mode" or "Standards Mode" ?
A few links worth mentioning:
http://blogs.msdn.com/b/ie/archive/2008/08/27/introducing-compatibility-view.aspx
http://blogs.msdn.com/b/ie/archive/2009/02/16/just-the-facts-recap-of-compatibility-view.aspx
http://msdn.microsoft.com/en-us/library/ms533876(VS.85).aspx
http://msdn.microsoft.com/fr-fr/library/cc288325(VS.85).aspx
http://blog.strictly-software.com/2009/03/detecting-ie-8-compatibility-modes-with.html
http://phrogz.net/ie8-intranet-compatibility-view
http://hsivonen.iki.fi/doctype/ -> http://hsivonen.iki.fi/doctype/ie8-mode.png
javascript:alert(navigator.userAgent)
javascript:alert(document.compatMode);
javascript:alert(document.documentMode);
IE Dev tools indicate which rendering engine is being used.
Don't rely on the User Agent string to determine the rendering engine.

Resources