Ted
Ted

Reputation: 75

Web speech recognition is blocked - possibly a security policy violation?

I have implemented the web speech api (webkitSpeechRecognition) in an application and it works as expected when running locally (localhost). Once deployed to a shared test server it throws the "not-allowed" error as soon as it starts to listen. I assume this means there is a security violation that prevents it from accepting input. However the site is HTTPS and fully secure (valid cert, no unsecure mixed content). It's not operating from within an Iframe.

I'm never prompted for permission to use the microphone. I have already tried setting microphone access within Chrome to "allow" for the site. I'm using the latest Chrome browser on Windows 10.

Does anyone know how to coax more detailed error info from this API? Has anyone come across similar problems in trying to implement this API?

thanks!

Upvotes: 1

Views: 882

Answers (1)

Ted
Ted

Reputation: 75

There is Feature-Policy HTTP header that can disable microphone usage on the page (as well as many other things). It happened to be set at the web server level where I could not see it.

Feature-Policy: camera 'none'; geolocation 'none'; microphone 'self'; usb 'none';

Upvotes: 2

Related Questions