Bug 239816
| Summary: | [iOS] Web Speech API doesn't work in WKWebView, but webkitSpeechRecognition is still exposed | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ali Juma <ajuma> |
| Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Normal | CC: | achristensen, beidson, bfulgham, sihui_liu, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ali Juma
The Web Speech API is available in Safari on iOS, but is not enabled for other WKWebView embedders. This means that sites that use the Web Speech API work in Safari on iOS but not in other browsers.
Please consider enabling this API more generally so that these sites work in all iOS browsers.
I've also filed FB9998082 for this request.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
rdar://92408768
Ali Juma
The current state in WKWebView is very confusing for web developers using feature detection, since webkitSpeechRecognition is exposed on window, but doesn't work (the permission prompt never appears). Here's a test page that works in Safari on iOS, but not on any other browser on iOS: https://www.google.com/intl/en/chrome/demos/speech.html
Sihui Liu
Hi Ali,
WebKit uses Speech framework for recognition, so your app might need to add NSSpeechRecognitionUsageDescription: https://developer.apple.com/documentation/speech/asking_permission_to_use_speech_recognition?language=objc.
Did you already do that?
Sihui Liu
or if you are a website developer... I think we will throw error when the app cannot prompt (e.g. due to missing the keyword), do you see the error? Or it's just nothing?
The API should work in WebKit app.
Ali Juma
(In reply to Sihui Liu from comment #3)
> Hi Ali,
>
> WebKit uses Speech framework for recognition, so your app might need to add
> NSSpeechRecognitionUsageDescription:
> https://developer.apple.com/documentation/speech/
> asking_permission_to_use_speech_recognition?language=objc.
>
> Did you already do that?
Thanks! That explains why it isn't working.
> or if you are a website developer... I think we will throw error when the
> app cannot prompt (e.g. due to missing the keyword), do you see the error?
> Or it's just nothing?
Yes, we get a service-not-allowed error when trying to use the API.