In this post, I describe how you can figure out if IE11 has jumped in the compatibility mode. This is quite important because in compatibility mode IE does its best to screw up your CSS.
Compatibility view now and before
Microsoft has been pretty keen on introducing new ways to handle browser compatibility and make IE behave in even stranger ways that it usually does by switching it to compatibility mode. There are a few reasons this could happen. In SharePoint’s case, perhaps the most usual one is that IE identifies the SharePoint site to be located in intranet zone… Or it’s actually set to that zone, or the list of sites to display in compatibility mode, via a group policy.
Before IE11 the switch was reasonably easy to notice. There would always be a button/icon similar to this on the address bar when the browser was in compatibility mode:
However, in IE11 Microsoft has removed the icon leaving the end users in the dark about whether the page is in compatibility mode or not. We COULD check the compatibility view and security zone settings to find out the mode, but there’s a better way, too. Now, we must check the developer tools (just hit F12 to bring the console up) to see, which document mode IE is using. IE11 in compatibility view may show us something similar to this:
But wait a minute – what if you can’t access the end user browsers yourself? Before it was pretty easy – you could just ask the end user to check for the compatibility view icon, since it was easily visible on the address bar! Nowadays you’re mostly out of luck – instructing the end users to actually use developer tools is probably going to be difficult. However, there’s a workaround for this.
Identifying compatibility view in IE11 without the use of Developer tools (F12)
A quote from the page says:
Modern versions of IE always have the Trident version number in the User Agent string. Older IE detection scripts looked for MSIE in the User Agent string, but this is no longer included in the string as of IE 11 while the browser is in normal mode. The MSIE number is included though, in all modern versions of IE including 11, if it is running in compatibility mode, and informs of the version of IE that the browser is running at. By looking at both the Trident Number and MSIE number if it exists, you can determine what the true version of IE is, if it is running in compatibility mode, and what compatibility mode it is running at.
Using this library, you can implement something like this in the script editor web part in SharePoint:
This kind of a script should output something similar to the text below if Internet Explorer is in the compatibility mode on the page this script is embedded in:
With this configuration, you can just ask your end-users to test if their browser is in compatibility mode or not. Navigating to this page and maybe taking a screenshot should be something your average end user is perfectly able to do. 🙂
Latest posts by Antti K. Koskela (see all)
- How to fix an Office Group with no Owners - November 14, 2018
- Help! My “Content and Structure” page in SharePoint Online is gone! - November 7, 2018
- Thanks for coming to my session at SPS New England 10/20 ! - October 20, 2018
- Speaking at SPS New England on 10/20! - October 17, 2018