IE 11 - Is there a way to check then enable / disable enterprise mode?

后端 未结 3 1217
一生所求
一生所求 2020-12-18 05:28

I am out of wit as how to solve this problem in Javascript or HTML. I have customers currently using web applications built for ie9 and under. These legacy applications do

相关标签:
3条回答
  • 2020-12-18 05:56

    To my mind the reason of the issue is that IE 11 Enterprise mode emulates IE 8. But bootstrap doesn't support IE 8. To overcome it just use HTML5 shim and Respond.js as described here.

    <script src="js/respond.min.js"></script>
    <script src="js/html5shiv.min.js"></script> 
    

    But without check like <!--[if lt IE 9]> - because it seems that it doesn't work in the enterprise mode.

    The better solution would be not just include the mentioned scripts without conditions but find out the appropriate condition instead of < IE 9.

    To fix the problem with angularjs just use the following meta tag:

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    0 讨论(0)
  • 2020-12-18 06:08

    For those who also struggled with this problem. I have submitted a feature request to MS IE Team.

    See: https://connect.microsoft.com/IE/feedback/details/1159543/need-a-way-for-client-side-codes-to-detect-enterprises-mode

    My solution is a workaround that involve checking the width of the container div. Enterprises mode do not support responsive.

    0 讨论(0)
  • 2020-12-18 06:21

    There is no DOM property that indicates that you're running EMIE. The whole idea of EMIE is to emulate IE8 behavior better than the IE8 document mode emulates IE8 behavior. EMIE should only be used in specific cases where it's needed; it should not be used wholesale.

    It is possible to detect EMIE in certain cases. If you look carefully at the list of user-agent strings over the last couple of releases, there's a noticeable difference between EMIE on IE11 and the user agent string for IE11 RTM.

    However, before you take that as your magic bullet, there are two caveats:

    1. You cannot disable EMIE programmatically. It's a local configuration change only.

    2. The user agent for IE11 is completely different today than it was when IE11 was released. Based on reports from the IE team, the UA string is going to be even more complicated, especially once "IE Spartan" (or whatever they choose to call it") hits the wire.

    My recommendation? Create a small launcher page that does a simple feature detection for the web app in question. If you detect features consistent with what's needed for the app, then display a link to launch the app. If feature detection fails to detect IE8, IE11, or whatever version you've targeted, display a warning with a link to more troubleshooting information. Be sure to include a launch link anyway, just in case.

    This way, the user has the information they need and you have a lightweight way of handling the issue, one that doesn't require too many updates to the app in question.

    Hope this helps...

    -- Lance

    0 讨论(0)
提交回复
热议问题