Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search


Home > Getting ready for production > Browser compatibility
xpageswiki.com
is maintained by 
Julian Buss.
You can hire me.

Browser compatibility

ShowTable of Contents

Internet Explorer 8 and Internet Explorer in general


IE 8 is supported since Domino 8.5.1.
You can force IE8 to act like IE7 by using this code in beforeRenderResponse event:

// first option uses compatibility mode, second option too but stronger
// X-UA-Compatible: IE=7
// X-UA-Compatible: IE=EmulateIE7
if (context.getUserAgent().isIE(8, 8)) {
  var exCon = facesContext.getExternalContext();
  var response = exCon.getResponse();
  response.setHeader("X-UA-Compatible", "IE=EmulateIE7");
}


or you can force IE8 to render the page in IE8 mode (and not in "compatibility mode"):

var exCon = facesContext.getExternalContext();
var response = exCon.getResponse();
response.setHeader("X-UA-Compatible", "IE=8");


You can use this style of code for any Internet Explorer version. For example, force IE9 to act like IE8:

if (context.getUserAgent().isIE(9, 9)) {
  var exCon = facesContext.getExternalContext();
  var response = exCon.getResponse();
  response.setHeader("X-UA-Compatible", "IE=EmulateIE8");
}


Redirecting to another page for special browser like iPhone


Found in Dec's Blog:

Use some code like this in beforePageLoad event:

    var uAgent = context.getUserAgent().getUserAgent();

    if (uAgent.match('iPhone') != null){
           context.redirectToPage('/iPhone.xsp');
    }


In a theme you could use a special CSS for a special browser:

<resource rendered="#{javascript:context.getUserAgent().getUserAgent().match('iPhone')}">
<content-type>text/css</content-type>
<href>iPhone.css</href>
</resource>

Browser sniffing


You can use dojo to check which browser a visitor uses:

dojo.isIE
dojo.isMozilla
dojo.isFF
dojo.isOpera
dojo.isSafari
dojo.isKhtml


Found at Bob Balfe
Created by Anonymous on Oct 21, 2009 7:15:08 PM

Hi, thank you for this info.

I have used this code in my xpage and it's working fine, so now I can see it in IE 7 and 8, but I'm having issues with Firefox 3.5. Is there a similar solution for Firefox 3.5? Thank you!


Created by Julian Buss on Oct 25, 2009 12:18:04 AM

the solution is to use Domino 8.5.1. :-)


Created by Anonymous on May 26, 2010 3:37:08 PM

In the theme code** match("iPhone") should read match('iPhone')


Created by Julian Buss on May 27, 2010 8:47:35 PM

fixed, thanks!


Created by Anonymous on Feb 4, 2011 5:09:46 PM

What about the opposite?

I have an XPages based site using 8.5.2 and the Extension Library. It seems to work much better not in IE 7 Compatability mode of IE 8, but users still using Compatability mode from before the Domino server upgrade and Extension Library added.

I really need to force IE 8 to not use Compatability Mode for this application.

Any ideas?


Created by Bruce Elgort on Jun 10, 2011 11:29:40 PM

Thank you for the info on this page! Saved my butt!


Created by Judy K on Dec 13, 2011 9:16:45 PM

I use this to force IE users to use edge-mode if it's available which prevents someone from putting your site into compatibility mode.

// X-UA-Compatible: IE=edge (will be highest possible renderer for that version)

var ua = context.getUserAgent();

var versionNbr = ua.getBrowserVersionNumber();

if (ua.isIE() && versionNbr >= 8.0) {

var exCon = facesContext.getExternalContext();

var response = exCon.getResponse();

response.setHeader("X-UA-Compatible", "IE=edge");

};


Created by Mark Corrigan on May 8, 2013 10:38:54 PM

Is there anything out there to force ie9 to act like ie7? IE9 doesn't play well with Xpage functions.


Created by Julian Buss on May 28, 2013 7:27:36 AM

Mark: you can use the X-UA-Compatible header fore every Internet Explorer, including 9.


Created by rjohnson on Aug 14, 2013 11:49:57 PM

Where and what code should I put the code to make it render in IE8 Standards' mode?


Add Comment

Name:
Comments:
How to take your XPages App to the iPhone, iPad, Android: use Domino To Go!
Do you look for an XPages Workflow solution? Take YouAtNotes Workflow.