0

I'm trying to use Web Speech API in my Chrome extension, but I'm getting not-allowed error.

I've read that this error occurs when a website without SSL tries to use Web Speech API, so is that means it's impossible to use it in a Chrome extension?

const recognition = new webkitSpeechRecognition();
            recognition.lang = 'en-US';
            recognition.interimResults = false;
            recognition.maxAlternatives = 1;
            recognition.onresult = event => {
                const result = event.results[0][0].transcript;
            };
            recognition.start();
Eliran Pe'er
  • 2,569
  • 3
  • 22
  • 33
  • Maybe try using it in an iframe which is in https? – Benjamin Gruenbaum Apr 08 '18 at 18:06
  • 1
    Try the answer of RobW's answer in this related [SO post](https://stackoverflow.com/a/30731204/5995040) and [here](https://stackoverflow.com/a/29183128/5995040). This might help you understand how to use web speech inside chrome extension, especially when encountering `'not-allowed'` error. Hope this helps. – Mr.Rebot Apr 09 '18 at 16:55
  • Thank you @Mr.Rebot, that was the answer I was looking for. :) – Eliran Pe'er Apr 09 '18 at 19:20

0 Answers0