Detecting IE Version Not Considering Compatibility Mode

I am trying to find out if it is possible to determine which version of IE you are using, and not your document-mode. It can be a server or client code (it does not matter), I just need to know which version of IE was installed by the user.

+3
source share
1 answer

It can be detected in both cases by examining the User-Agent string. Note that browsers can spoof their UA string, but now this is less common than in the past. See this article on MSDN for older UA strings.

Note that IE8 sends another UA string in compatibility mode and standard mode (see this and this - both are IE8, although the first one says MSIE 7.0).

See this for a long list of UA strings - note that you should look for a pattern, not an exact match, as the installed software will change the UA string.

In IE9 there is a new line of the line - see IEBlog for more details .

To summarize (and borrow from @EricLaw's comment ):

  • no Trident in UA string - check string MSIE [0-9].0for version
  • Trident / 4.0 - IE 8, Version B MSIEDoesn't Matter
  • Trident / 5.0 - IE 9
+3
source

Source: https://habr.com/ru/post/1782291/


All Articles