Monday 7 May 2007

Does Matchpeg support the Opera web browser?

Matchpeg supports Internet Explorer (v6 or later), Safari, and all Gecko-based browsers such as Firefox and Camino.

We don't support Opera.

This is because there's an obscure bug in Opera which affects only Matchpeg and a few other sites. The main effect is that error messages don't get displayed - if an error occurs, we have to display a generic failure message rather than the proper explanation of the error. (See below for the technical reason why.)

So, Matchpeg is more or less usable with Opera, but if an error occurs you won't know what or why.

Yes, we've told Opera about this. No, they haven't done anything about it (or, indeed, even responded).

--

Tech details:

The problem is in Opera's XmlHttp handling. Opera doesn't follow the de facto standard which all other browsers adhere to. It's arguable that Opera's implementation doesn't even follow RFC 2616 properly.

When Matchpeg's web pages make XmlHttp calls (e.g. in order to log on), there are obviously two possible results: success (and some data), or an error. The XmlHttp pages on the server signal which has occurred using the HTTP status code. The usual code 200 means that the call has succeeded (e.g. logged on successfully), and the XmlHttp responseText member then contains any applicable data. The code 299 is used to mean that an error occurred (e.g. invalid user name or password), and responseText contains a textual error message to display to the user.

This gives the Javascript in the client-side web pages a simple way of checking what's happened. If you look at Matchpeg's Javascript, you'll see lots of code along the lines of the following:


switch (XmlHttp.status) {
case 200:
// Success. Do something with the
// data in XmlHttp.responseText
break;
case 299:
// Error! Display the message to the user.
alert(XmlHttp.responseText);
break;
default:
// Must be a 400+ or 500+ error - i.e. a
// problem with the server configuration.
break;
}



(We think this is quite elegant.)

The problem is that Opera drops the HTTP response body for all XmlHttp calls where the status code is anything other than 200. Therefore, a blank error message gets displayed.

There are three reasons for considering this a bug in Opera:

  • No other browser behaves this way.
  • There's nothing in RFC 2616 which obviously supports Opera's behaviour.
  • If Opera makes a normal (i.e. non-XmlHttp) request to a page which returns a status code such as 299, then it does display the response body. In other words, Opera's behaviour isn't consistent, and this tends to suggest that the XmlHttp implementation is in breach of RFC 2616.

We could, of course, change Matchpeg to pass back XmlHttp results in a way which works with Opera. But, frankly, it's not worth working round a bug in a browser which about 0.3% of our potential customers use.