3

Is there a way to trigger Siri from a webpage (perhaps using Javascript), to fill an input text field?

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
Matteo
  • 1,217
  • 1
  • 13
  • 17

1 Answers1

7

You probably cannot trigger Siri directly but you can use the x-webkit-speech html5 input type which will add the ability to use voice input:

<input type="text" x-webkit-speech>

It should be available in mobile safari as well: http://caniuse.com/#feat=web-speech

For more information you could e.g. refer to: http://blog.teamtreehouse.com/accepting-speech-input-html5-forms

k-nut
  • 3,447
  • 2
  • 18
  • 28
  • You can check the support of voice input by running this snippet in mobile safari: `alert(document.createElement('input').webkitSpeech !== undefined)` . If it returns `true` you should be able to use it, if it returns `false` not. Unfortunately there seems to be very little information about voice input for mobile safari out there... – k-nut Nov 12 '14 at 07:14
  • `x-webkit-speech` is deprecated. See this StackOverflow [Question](http://stackoverflow.com/questions/23188951/x-webkit-speech-is-deprectated-a-js-replacement-for-simple-speech-input-for-in) for an alternate solution. – Joshua Kolden Dec 29 '16 at 21:35