*** Welcome to piglix ***

Modernizr

Modernizr
Modernizr logo.png
Original author(s) Faruk Ateş
Developer(s) Faruk Ateş, Paul Irish, Alex Sexton, Ryan Seddon, Patrick Kettner, Stu Cox, Richard Herrera, and contributors
Initial release 1 July 2009
Stable release
3.3.1 / 15 January 2016
Repository github.com/Modernizr/Modernizr
Written in JavaScript
Type JavaScript library
License MIT; it was dual-licensed MIT-BSD from June 14, 2010 to September 15, 2012
Website modernizr.com

Modernizr is a JavaScript library which is designed to detect HTML5 and CSS3 features in various browsers, which lets JavaScript avoid using unimplemented features or use a workaround such as a shim to emulate them. Modernizr aims to provide this feature detection in a complete and standardized manner.

Many HTML5 and CSS 3 features are already implemented in at least one major browser. Modernizr determines whether the user's browser has implemented a given feature. This lets developers take advantage of new features that browsers support, yet create fallbacks for browsers that lack support. In both 2010 and 2011, Modernizr won the .net Award for Open Source App of the Year, and in 2011 one of its lead developers, Paul Irish, won the Developers of the Year award.

Modernizr uses feature detection, rather than checking the browser's property, to discern what a browser can and cannot do. It considers feature detection more reliable since the same rendering engine may not necessarily support the same things in two different browsers using that engine. In addition, some users change their user agent string to get around websites that block features for browsers with specific user agent settings, despite their browsers having the necessary capabilities.

Modernizr offers tests for more than 250 features, then creates a JavaScript object (named "Modernizr") that contains the results of these tests as boolean properties. It also adds classes to the HTML element based on what features are and are not natively supported.

To perform feature detection tests, Modernizr often creates an element, sets a specific style instruction on that element and then immediately tries to retrieve that setting. Web browsers that understand the instruction will return something sensible; browsers that don't understand it will return nothing or "undefined". Modernizr uses the result to assess whether that feature is supported by the web browser.


...
Wikipedia

...