I've started to make a little speech recognition app
let loading = document.getElementById('loading')
let main = document.getElementById('main')
let speech = new webkitSpeechRecognition();
let isLoading = true
speech.addEventListener('error',(e)=>{
switch(e.error){
case 'not-allowed':
// Visual code here left out
break;
default:
console.error(e)
break;
}
})
speech.addEventListener('end',()=>{
speech.start();
})
function parseResult(result){
if(result.type == 'result'){
let text = result.results[result.resultIndex][0].transcript
// Visual code here left out
}
}
speech.onresult = parseResult;
speech.continuous = true;
speech.start();
And it works well once, then once I refresh it throws this every 5 seconds or so:

This is fixed by going to chrome://restart, but I would like it if users didn't have to restart their entire browser every time they went to the app.
Any idea of what's happening?