Last active
September 5, 2017 13:11
-
-
Save edm00se/7750566 to your computer and use it in GitHub Desktop.
Place in the beforeRenderResponse event of an XPage to force IE versions <= 9 to use Edge (and disable Compatibility View Mode) and force newer versions than 9 to act like IE 9 (and disable Compatibility View Mode).By my experience, this enforces as much compatibility as possible for XPages with Domino 8.5.3 (my servers are on UP1, not that that…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// forces IE9 and below to not use compatibility mode, and forces any registered as IE >=10 to act like 9 | |
if(context.getUserAgent().isIE()&&context.getUserAgent().getBrowserVersionNumber()<10) { | |
var exCon = facesContext.getExternalContext(); | |
var response = exCon.getResponse(); | |
response.setHeader("X-UA-Compatible", "IE=Edge"); | |
}else if(context.getUserAgent().isIE()&&context.getUserAgent().getBrowserVersionNumber()>9 || (context.getUserAgent().getUserAgent().indexOf('Trident/7') > -1 && context.getUserAgent().getUserAgent().indexOf('rv:11')){ | |
var exCon = facesContext.getExternalContext(); | |
var response = exCon.getResponse(); | |
response.setHeader("X-UA-Compatible", "IE=9"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you for sharing. this overrides ie user settings and works perfect.