新闻

Modernizr 1.5: new features, unit tests added

We're proud and pleased to announce the immediate release of Modernizr 1.5!

Rather than an incremental upgrade, we've opted to shift into a higher gear and add the full shebang of what we've been working on. Here's a list of new things we detect:

Additionally, IE can now print HTML5 elements (courtesy of @jon_neal's print protector), IE9 should be fully supported (let us know if you discover inconsistencies), and we also support more browsers: older Safari versions, Nokia and Blackberry mobile browsers, and Konqueror via the -khtml- prefix. Detection of Opera's CSS3 support for transitions and transforms was fixed, as well.

A few big things have kept us busy preparing a good release. Flash detection (Flash Blockers included) became a hot topic and we really wanted to include it, but at the time no reliable or complete mechanism was available. We wanted to include (and still recommend) Mark Pilgrim's excellent Flash Block Detector but decided that it was too large a codebase to include in the default release of Modernizr—especially given the modular Modernizr 2 plans on the horizon—and so Flash detection is out for now.

Then came the discovery that Google Chrome implemented Touch events even on the desktop (why, Google, why?) paired with the regrettable fact that Palm's WebOS browser doesn't support common Touch events at all. For a browser that only exists on touch-based devices, this was too critical an issue for us to ignore. So Touch testing went out again, too.

We have many more features we'd like to include; please visit the GitHub issue tracker to review all the additional tests.

For developers, contributors and people looking to learn from Modernizr we now have a set of unit tests available on the GitHub repository, courtesy of Paul. These help prevent errors and inconsistencies from finding their way into the source code, making Modernizr more robust and reliable. The unit tests also include a second part, which pulls the data tables in from Find Me By IP and creates a feature parity overview for all the browsers.

Along with the 1.5 release comes a license upgrade: Modernizr is now dual-licensed under BSD and MIT.

Thanks for all the input and code to miketaylr, fearphage, kangax, richbradshaw, @itpastorn, @jon_neal, dshaw, itrelease, mathiasbynens, airportyh, jeffsmith, rjcoelho, lucideer, peol and mislav. The high quality of this release wouldn't be possible with input from experts like these.

We hope you enjoy the hard work we've all put into it, but we'd love to hear your feedback on Modernizr 1.5's new changes, so let us know via Twitter what you think!