1

So I need to use the webkitSpeechRecognition() api to read voice input from the user and then fill a text area with whatever value is returned for webSpeechRecognition. Now the problem is when I do that from a popup page in chrome extension, it does not asks for microphone access. How can I solve it ? I have read this answer https://stackoverflow.com/a/29183128/5143144 but I am unable to make anything of it. Another issue is, even if I am able to get microphone access, is it possible to use it to do webkitSpeechRecognition in the popup of the chrome extension. Please help. Thanks.

4

1 回答 1

0

I solved this after searching a lot and getting a reference from one of the stack overflow answers and chrome forums. Just leaving this here in case you find it useful.

So all you have to do is ask for the permissions on a different page which has the extension url. Once a user allows permission to microphone there, your browser extension will be able to access microphone.

于 2018-06-19T06:00:03.443 回答