modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
20 lines (19 loc) • 546 B
JavaScript
/*!
{
"name": "Vibration API",
"property": "vibrate",
"notes": [{
"name": "MDN documentation",
"href": "https://developer.mozilla.org/en/DOM/window.navigator.mozVibrate"
},{
"name": "W3C spec",
"href": "https://www.w3.org/TR/vibration/"
}]
}
!*/
/* DOC
Detects support for the API that provides access to the vibration mechanism of the hosting device, to provide tactile feedback.
*/
define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
Modernizr.addTest('vibrate', !!prefixed('vibrate', navigator));
});