A Guide to HTML5 Features You Can't Detect

What language does that browser speak? Web developers looking to play with the new features in HTML5, CSS 3 and other NEWT tools are still struggling with incomplete and inconsistent browser support. While HTML5 and its siblings are far from perfect (and complete), that doesn’t mean you can’t use them; it just means using them […]

What language does that browser speak?What language does that browser speak?

Web developers looking to play with the new features in HTML5, CSS 3 and other NEWT tools are still struggling with incomplete and inconsistent browser support. While HTML5 and its siblings are far from perfect (and complete), that doesn't mean you can't use them; it just means using them is a little more complicated since you need to detect the current browser's level of support and then adjust accordingly.

One of the easiest ways to detect the current web browser's level of HTML5 support is the Modernizr JavaScript library. We've covered Modernizr several times in the past and it's a great addition to any HTML5 toolkit.

But sadly, not everything can be detected with JavaScript. If you've ever bashed your head against the keyboard trying to figure out why something wasn't being detected, Modernizr has a new wiki page for you: The Undetectables.

The page lists a number of features that simply can't be detected using general feature tests. Instead, these features can be found by either user agent sniffing (which leads to heartache and doom), browser inferences or as the wiki puts it "simply providing the same (slow) fix to everyone."

In some cases there are workarounds, like the great keypress JavaScript effort from Google, which fixes a number of erratic, inconsistant keyboard behavior quirks in today's browsers. However, in many cases you're probably better off avoiding the undetectable features until browsers catch up.

If your code has been behaving strangely, despite your best efforts to detect a browser's features, save yourself some hair pulling and head over the new Modernizr page to see if perhaps the problem is on the list of things that can't be detected. If you discover other problems trying to sniff a browser's capabilities, be sure to let the Modernizr devs know about it.

See Also: