Did you notice it? Well if you’re an Opera user you might. As of last week, if you go to Bing using Opera, you’ll get to see the HTML5 background video in all its glory.

Now, let’s be clear, it’s not as if Opera couldn’t play the video before. It just never got the chance.

You see Bing used browser sniffing to determine what it thought visitors’ browsers could and could not deal with. Browser Sniffing is, to my mind, a relic that should have been put to rest years ago. But, like a bad smell, it’s just hung around.

The problem with browser sniffing is – and I believe this is the technical term – it’s just a bit pants. With so many browsers and so many user agent strings (not to mention browsers pretending to be other browsers) you simply can’t guarantee the right result.

This means you’ll tend to exclude at least a portion of your audience (probably unnecessarily as most browsers deal with most code just fine – as in the Bing example with Opera).

The solution to Browser Sniffing? Feature detection… Rather than guessing at what the browser is capable of, you use JavaScript to test the browser. In general this is far more accurate and delivers far better results.

To learn more about feature detection – and particularly how to write a feature detection tests in JavaScript – check out my earlier post. And to see a demo in action, take a look at the tutorial video I created with Ubelly detailing how Sky News used feature detection in a proof of concept project I worked on last year.