IE9 displays intranet sites as IE7 - how to prevent this

IE9 displays intranet sites as IE7 - how to prevent this

by Stuart Lamour -
Number of replies: 17
Picture of Plugin developers

At sussex.ac.uk anything within the domain of sussex.ac.uk is seen by student & staff machines as being part of the intranet.

This causes a strange effect in IE9.

Sub domains e.g. moodle.sussex.ac.uk are rendered by IE9 as IE7.... 

But we know how to fix this right? 

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

Well, almost. 

Like most good developers we are setting some browser specific classes and ids on the html tag using conditional comments - 

[if lt IE 7] , [if IE 7], [if IE 8], [if gt IE 8] etc... 

and we were doing this before setting X-UA-Compatible.

The effect was IE9 defaulted to the IE7 view for intranet sites on seeing these conditional comments, and before getting to the X-UA-Compatible. 

A solution

If your doing any IE conditional comments, set the  X-UA-Compatible first.

It's the opposite of best practice in html5boilerplate.com and other guides, but it did the job for us.

Be interested to know if anyone has any other methods of dealing with this?

Average of ratings: Useful (1)
In reply to Stuart Lamour

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Just to throw something else out there in the mix... there's currently a flash bug that affects IE 9 when using SCORM - so you have to make sure IE9 runs in IE 8 compatibility mode....

more info here: MDL-29213

In reply to Dan Marsden

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Stuart Lamour -
Picture of Plugin developers

Dan -is this one to do with the actual embed code or the flash? We had problems with flash and quicktime embed code in IE9 - it needed to run as 8 to suport the 'old school' embed and object code. All worked fine though with a bit of browser sniffing and just using the object code for IE9.

roll on IE10!

In reply to Stuart Lamour

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Danny Wahl -

I'm not an expert at Active Directory, but it sounds like your domain controller is sussex.ac.uk - meaning that anything underneath that really (according to AD) should be intranet, but instead you've added some reverse lookups to allow them to be extranet.

The other solution would be to either move your website (extranet) or your DC (intranet) to a different domain like sussex.com or sac.com so you don't have the conflict.

Again, not an expert, but I have dealt with this before - just not for some number of years.

In reply to Stuart Lamour

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Paul Holden -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Assuming your network team use Group Policy, couldn't you just disable this setting in the browser rather than rely on these workarounds... wink

The setting in IE9 is under Tools > Compatibility View Settings > Display intranet sites in Compatibility View

In reply to Paul Holden

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Stuart Lamour -
Picture of Plugin developers

@paul & @daniel - you have obviously never met our network team ;)

The unfortunate reality is that there are still a plethora of legacy systems for specific departments/tasks in sussex.ac.uk (and probably most underfunded, under-resourced research/IT departments in large institutions) that do need that compatibility actually thing to work. I don't see anyone having the time/budget to update these systems any time soon sad 

In reply to Paul Holden

Re: IE9 displays intranet sites as IE7 - how to prevent this

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Apart from the difficulty of getting network teams to make changes, if you ever have users from outside your network, then this isn't a solution. A significant number of external users have compatibility view enabled; our IE7 stats halved (from about 13% to about 6%) once I corrected my browser stats system to detect the relevant user agents. smile

So in other words you always need to have the X-UA-Compatible header (e.g. at top of the head tag in source code) or else behaviour won't be reliable. For OU theme we just added it in:

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

Seems to work... I hope. smile

--sam

In reply to sam marshall

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Dan Poltawski -
Should we be doing this sort of thing in core?
In reply to Dan Poltawski

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

can't easily yet sad

http://tracker.moodle.org/browse/MDL-30039

also - once we fix this in core - it won't affect all custom themes that have already been developed...

In reply to Dan Marsden

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Dan Poltawski -
Well, to put it another way - should we be defaulting to 'Yes IE behave like a modern browser' and then provide overrides for things like scorm (which surely is better than themes forcing it and breaking SCORM?).

It'd be terrible if we have 'modern' IE requirements, but it was still always falling back to compatibility mode.
In reply to Dan Poltawski

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

that's the point of MDL-30039 - allowing us to inject stuff into the head in a clean way - I can't see how this can be done easily without modifying each theme to add a hook - which means those hooks won't appear in non-core 2.x themes unless the theme authors update them.

at the moment we have $CFG->additionalhtmlhead that we can hijack like I did in MDL-29213 (which unfortunately doesn't actually work as it doesn't put it as first item in <head>

but we need a way to inject stuff as the first item in <head> - should be relatively easy to patch "core" themes to do this.

In reply to Dan Marsden

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Stuart Lamour -
Picture of Plugin developers

If we think it should be in core then rather than waiting :

  • start including it now in themes moodle issues as standard
  • put it in the documentation as best practice and advice for theme builders

then when you have the functionality to inject it into the head, do so.

In reply to Stuart Lamour

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There's a bit of a workaround using Apache's mod_header - you can have Apache send the X-UA-Compatible header with every request, or requests for certain directories/sites. It's not a solution if you're writing a module that needs IE to do something specific, but if you just need to fix your own server it's a solution that doesn't require hacking Moodle core.

Average of ratings: Useful (1)
In reply to Mark Johnson

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Stuart Lamour -
Picture of Plugin developers

anyone know if setting the X-UA-Compatible in the .htacess makes the moodle body class behave corectly?

(from html5boilerplate)

 
<IfModule mod_headers.c>
  Header set X-UA-Compatible "IE=Edge,chrome=1"
  # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
    Header unset X-UA-Compatible
  </FilesMatch>
</IfModule>

https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess

In reply to Stuart Lamour

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

If not solved, could this be a Byte Order Mark issue, please see comments on http://tracker.moodle.org/browse/MDL-31343.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Julian Davis -

We had the same issues and I found that if I added the following metatag to be the first element after <head> it fixed our issue.

<meta http-equiv="X-UA-Compatible" content="IE=8">

If you update the following theme files, it also rebders the change upgrade safe:

theme/your-theme/layout/embedded.php (line 7)

theme/your-theme/layout/frontpage.php (line 48)

theme/your-theme/layout/general.php (line 46)

 

In reply to Julian Davis

Re: IE9 displays intranet sites as IE7 - how to prevent this

by Julian Davis -

To make it compatable with IE8 and IE9, update the meta tag to:

<meta http-equiv="X-UA-Compatible" content="IE=8,IE=9">