3

I am implementing to programmatically disable IE compatibility mode for IE8/9/10/11. I have added:

FacesContext.getCurrentInstance().getExternalContext()
       .setResponseHeader("X-UA-Compatible", "IE=9; IE=8; IE=7; IE=EDGE");

But is not working in IE11.

Tiny
  • 27,221
  • 105
  • 339
  • 599
Shayan Ghosh
  • 882
  • 6
  • 14
  • 2
    You could try adding a meta tag ``, that has worked for me in the past. – akxlr Apr 10 '15 at 08:15
  • My plan is to do in Server side... – Shayan Ghosh Apr 10 '15 at 08:27
  • 1
    Why 'serverside'? Isn't xhtml serverside to? – Kukeltje Apr 11 '15 at 09:06
  • 1
    Browsers are not driven by a server. You cannot do this by any means on the server-side. You have to rely upon the client which is always exploitable - whether you do it or not, it can always be uncovered. The code snippet you provided is merely analogous to `HttpServletResponse#setHeader(String name, String value)` under the hood. *IE compatibility mode* is ever epic fail. They should not even have provided this option. – Tiny Apr 11 '15 at 12:49
  • 1
    IE 11 changed the user agent string and affiliated behavior. Ref: https://msdn.microsoft.com/en-us/library/ie/bg182625%28v=vs.85%29.aspx#uaString – Eric McCormick Apr 25 '15 at 02:06
  • Have a look at this http://stackoverflow.com/questions/6546775/how-to-forcefully-set-ies-compatibility-mode-off-from-the-server-side – cweitat Nov 09 '15 at 09:20

0 Answers0