What is the most reliable part of the user-agent string to detect Internet Explorer?
For example, does the version token always start with MSIE using Internet Explorer?
Can MSIE show up as the token of another browser?
http://msdn.microsoft.com/en-us/library/ms537503%28开发者_StackOverflowv=vs.85%29.aspx
All versions of Internet Explorer (or at least every one that I have ever seen; certainly every one that you are likely to encounter online) contain the string "MSIE" by default.
However, there are numerous other browsers, agents, and crawlers that contain that string, most notably various versions of Opera. And of course, the user-agent string can easily be changed by users.
Therefore, you should not absolutely rely on the user-agent string to identify browsers for any critical purpose.
精彩评论