Based on the Google example, it seems that there is no browser wide property that state user's permission.
The right solution (as for now) is to listen for onstart
and onend
events to set the property in the scope of your speech recognition logic
var permission = false;
var recognition = new webkitSpeechRecognition();
recognition.continuous = true;
recognition.interimResults = true;
// Start event is fired when user accept
recognition.onstart = function() {
permission = true;
}
// End event is fired when the permission expire
recognition.onend = function() {
permission = false;
}
recognition.start();