modernizr
4
Detect Mobile Browser Capabilities with Modernizr

Modernizr is a small JavaScript library that detects the availability of native implementations for next-generation web technologies (HTML5/CSS3). Unlike with the traditional browser-sniffing, which is unreliable, Modernizr does actual feature detection to discern what the various browsers can and cannot do. Designers can take advantage of new features in the browsers that can render or utilize them, and still have easy and reliable means of creating fallbacks for the browsers that cannot. Using feature detection is a much more reliable mechanic to establish what you can and cannot do in the current browser, and Modernizr makes it convenient for you in a variety of ways:

  • It tests for over 20 next-generation features, all in a matter of milliseconds
  • It creates a JavaScript object (named Modernizr) that contains the results of these tests as boolean properties
  • It adds classes to the html element that explain precisely what features are and are not natively supported
Modernizr detects support for @font-face, Canvas, Canvas Text, HTML5 Audio, HTML5 Video, rgba(), hsla(), border-image, border-radius, box-shadow, text-shadow, opacity, Multiple backgrounds, Flexible Box Model, CSS Animations, CSS Columns, CSS Gradients, CSS Reflections, CSS 2D Transforms, CSS 3D Transforms, CSS Transitions, Geolocation API, localStorage, sessionStorage, SVG, SMIL, SVG Clipping, Inline SVG, Drag and Drop, hashchange, X-window Messaging, History Management, applicationCache, Touch events, Web Sockets, Web Workers, Web SQL Database, WebGL, IndexedDB, Input Types†, Input Attributes

Check out the Modernizr website for download and documentation

Facebook Twitter Email Reddit Stumbleupon Digg
Chris
0 Comments
Your Name Email Website