JamesBrill / react-speech-recognition

💬Speech recognition for your React app
https://webspeechrecognition.com/
MIT License
645 stars 116 forks source link

Expose when a browser doesn't support a polyfill #100

Closed JamesBrill closed 3 years ago

JamesBrill commented 3 years ago

Currently, when a polyfill is used, browserSupportsSpeechRecognition will always be true. However, while polyfills will be widely supported across browsers, there are exceptions like Internet Explorer that don't support standards like MediaStreams. As per the POLYFILLS.md doc, the burden is on the consumer to check for this browser support. This library should pick up that burden.

A quick win to avoid broken experiences on Internet Explorer is for browserSupportsSpeechRecognition to check for the presence of common APIs used by polyfills. I need to identify what the best proxy for these APIs is - i.e. what object to look for in the window. To do that, I'll need to get a handle on all the web APIs that are required to make a Speech Recognition polyfill (WebRTC API, Media Streams API, etc).

JamesBrill commented 3 years ago

Addressed by https://github.com/JamesBrill/react-speech-recognition/releases/tag/v3.8.1