6

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 not work well on IE11. IT solutions was to enable enterprises mode. Enterprises mode was designed to avoid "common compatibility problems associated with web apps written and tested on older versions of Internet Explorer".

See: http://www.eightforums.com/tutorials/43972-ie11-enterprise-mode-enable-disable-users.html

Enabling enterprises mode appear to be problematic on web application written using Bootstrap and AngularJS. Ie, responsive does not work at all unless enterprises mode is disabled. Not just AngularJS and Bootstrap but other libraries as well.

The solution that I am looking for is a way to check the status of enterprises mode via javascript, then tell the users to either enable / disable the mode. Better, if it can be turn off / on automatically via JS or HTML attributes.

Snooping in the document.x and window.x objects, I do not see any properties that we would give me an indication that enterprises mode is enable. Any suggestion?

Repro(s):

  • IE11 > Developer Tool > Console > Type window
  • IE11 > Developer Tool > Console > Type document
Patrick Thach
  • 138
  • 1
  • 1
  • 6
  • If Enterprise Mode is anything similar to Compatibility Mode, you should be able to check `document.documentMode` against a specific version number. – user1620220 Mar 02 '15 at 20:21
  • It sounds to me like you're looking for the [X-UA-Compatible](https://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible) meta tag. Setting it requires no action on the user's end, and allows your page to specify the document mode it should be rendered in, regardless of the browser default. – Waxen Mar 02 '15 at 20:21
  • 1
    @Waxen I think IE settings can override that tag. – user1620220 Mar 02 '15 at 20:24
  • @user1620220 I don't know about "Enterprise Mode," but the meta tag will definitely supersede the "Display intranet sites in compatibility mode" setting that's been around for a while. The whole point of the `X-UA-Compatible` tag is to give developers the ability to specify a document mode, it would be silly to expect a browser default to know better than a site's own developer. But then again I will never cease to be amazed with the silly decisions made by the IE team over the years. – Waxen Mar 02 '15 at 20:28

3 Answers3

5

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

Lance Leonard
  • 3,285
  • 3
  • 16
  • 15
  • Thank you for your suggestions. You pointed to the right path. – Patrick Thach Mar 03 '15 at 23:36
  • I have a sub-application inside my main application which opens in a pop up window. Somehow my sub application opens with in enterprise mode and I get UI issues. Any idea/suggestion why it is opening in Enterprise mode? – Saumyaraj Feb 26 '16 at 06:24
2

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">
Andrei
  • 73
  • 5
1

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.

Patrick Thach
  • 138
  • 1
  • 1
  • 6
  • Anything that detects Enterprise Mode should also detect the version of IE being used by Enterprise Mode - e.g. you should not be able to differentiate between IE 8 and EM IE 8. That is the whole point of Enterprise Mode. – NetMage Sep 01 '16 at 16:02
  • Here is the relevant User Voice issue as well: https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/11265198-need-a-way-to-detect-enterprise-mode-from-client-s – travis Oct 18 '16 at 16:00