IE 11 browser recognizes itself as Mozilla [duplicate]

ε祈祈猫儿з 提交于 2019-11-30 20:14:10

Yes. IE 11 doesnt say it is IE anymore, it says it is Mozilla.

Althoug, all IE versions respond the word Trident (its layout engine) in all of its versions.

So something like this could work in your javascript

<script type="text/javascript">
    CheckIE();
    function CheckIE()
    {
    var Browser;
    Browser = navigator.userAgent;
    if (Browser.indexOf("Trident") == -1)
    {
        //WHATHEVER YOU WANT IF IT IS NOT INTERNET EXPLORER
    }
    }
</script>

Yes, it does:

The compatible ("compatible") and browser ("MSIE") tokens have been removed.

...

These changes help prevent IE11 from being (incorrectly) identified as an earlier version.

Still there are some ways to detect it (search for "How to detect ie11"), but your best bet is to remove browser-detection code at all.

This is because IE 11 has a different style of user agent strings then previous versions of IE

http://msdn.microsoft.com/library/ms537503.aspx

User-Agent: Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko

Take a look at User agent string of IE 11: http://msdn.microsoft.com/en-us/library/ie/hh869301(v=vs.85).aspx

Now it says:

Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko

And more details: http://www.nczonline.net/blog/2013/07/02/internet-explorer-11-dont-call-me-ie/

I think that this is the reason.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!