0

I have an Accessibility Service which listens to UI events from installed apps in an emulator. These events are can be when a user enters text in a text box or clicks on a button, etc. I can capture these events if the control is not part of a webview. For webview it doesnt work, and I do not get events for graphic controls inside the webview. With API level level 18, we can request for Enhanced Web Accessibility in an Accessibility Service for webviews and hybrid apps. I have enabled this flag in my Accessibility Service properly. Yet, I do not get any events from controls in a webview. Why doesn't my accessibility service receive events for webviews event though I have set the flag correctly and am using API level 18? The Android documentation refers to javscript injection. Do i need to inject javascript for this to work? If so can you please help me with a code snippet or a reference to do that? Thanks for your help.

stamhaney
  • 1,246
  • 9
  • 18
  • When a service requests "enhanced web accessibility," the platform injects a Javascript-based screen reader into web content. This is separate from your accessibility service and connects directly to text-to-speech. You will not receive any events from the web content. – alanv Aug 21 '13 at 07:24
  • Thanks @alanv. Is there any way to receive events for the web content? If the screen reader can get the events and the information of the element inside the web control, can Accessibility Services in any way do this? – stamhaney Aug 21 '13 at 08:54
  • You would need to add your own JavaScript bindings on a WebView and forward events to your own AccessibilityService. This won't work for arbitrary apps -- you would have to instrument each WebView in a particular app. – alanv Aug 25 '13 at 18:16

0 Answers0