modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
26 lines (25 loc) • 724 B
JavaScript
/*!
{
"property": "speechrecognition",
"caniuse": "speech-recognition",
"tags": ["input", "speech"],
"authors": ["Cătălin Mariș"],
"name": "Speech Recognition API",
"notes": [{
"name": "W3C Spec",
"href": "https://w3c.github.io/speech-api/speechapi.html#speechreco-section"
}, {
"name": "Introduction to the Web Speech API",
"href": "https://developers.google.com/web/updates/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API"
}]
}
!*/
define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
Modernizr.addTest('speechrecognition', function() {
try {
return !!prefixed('SpeechRecognition', window);
} catch (e) {
return false;
}
});
});