Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search

Available in the Appstore!All the content of xpageswiki.com for iPhone or iPad for offline access.

Home > Getting ready for production > Browser compatibility

Browser compatibility

ShowTable of Contents

Internet Explorer 8


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");


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");

};


Add Comment

Name:
Comments:
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.
Did this information help you?
Please honor our efforts and flattr this!