Using Chrome Frame : How To Do It


As you may know,
Chrome Frame
is a way of running Google Chrome inside of Internet Explorer, via a plugin. Chrome is approximately one bazillion times better than IE[1]
, but many organisations may mandate the use of Internet Explorer. If they do, but a little more lax on installing plugins, it would be handy to be able to use Chrome Frame for Vaadin Applications.

I can confirm that, with a tiny bit of configuration, you can get Vaadin apps running in Chrome inside of IE - simply by sending the appropriate header from the initial “bootstrap page”.

Here is an example of an extended application servlet, appropriately configured. Buy referring to ExampleApplicationServlet below instead of com.vaadin.terminal.gwt.server.ApplicationServlet in your web.xml, you can make your applications use Chrome Frame if it installed.

(It would also be possible to do a redirect and ask-to-install, if you wanted to; that’s not a requirement of ours).

As you can see it’s very, very easy, so I thought I’d share.



That may not be scientifically provable. Other limits and restrictions may apply. Your mileage may vary.

public class ExampleApplicationServlet extends ApplicationServlet {
  protected void setAjaxPageHeaders(HttpServletResponse response) {
   response.addHeader("X-UA-Compatible", "chrome=1");