2

Do any of the commonly used screen readers emit browser events that can be scripted with javascript?

Or, are there current or planned javascript APIs to communicate with screen readers in the same way there are now APIs for working with other OS level systems (cameras, GPS, etc.)?

A similar question from three years ago (Evaluating current state of a screen reader in JavaScript) produced a definitive "NO" answer. Has anything changed since then?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Edward F
  • 43
  • 4
  • a screen reader should be "invisible" to you. are there screen reader events you want to trap? for example, pressing 'H' to go to the next header or using the up/down arrow keys to walk the accessibility tree (similar to the DOM)? if those events were trappable, that might be scary. that means the JS developer could intercept them and change the meaning of the key, which would be confusing for the screen reader user. JAWS (one example of a screen reader) **does** have a scripting language, but it's separate from JS - https://www.freedomscientific.com/products/blindness/jawsdocumentation – slugolicious Nov 07 '18 at 20:39
  • Good point. My desire here is would seem to be expressed exactly by this paragraph from WAI-ARIA spec: "User agents MUST provide a method to notify the web application when a change occurs to states or properties in the system accessibility API. Likewise, web application authors SHOULD update the web application accordingly when notified of a change request from the user agent or assistive technology." Found this after posting my question. – Edward F Nov 07 '18 at 22:16
  • I can see the confusion. You're not really listening for screen reader events but rather you're listening for what the gesture or shortcut from the screen reader maps to and you listen for that mapped event. The AOM that @Andre posted talks about this too, if you navigate to the CSUN paper, pages 3 and 4 talk about the events, but they're not really screen reader events like swipe or the arrow key, but rather events that those actions map to. It's subtle but different. Not sure if that makes sense. – slugolicious Nov 09 '18 at 03:48
  • @slugolicious thanks for pointing out the difference, a subtle but important distinction – Edward F Nov 12 '18 at 16:59

1 Answers1

1

I believe, it's still a No, but the closest to your request is the (drafted) Accessibility Object Model. It does not allow to interact with screen readers directly (it seems), but it does allow to manipulate the accessibility tree in a browser.
Currently supported at least in Chrome Canary via a command-line flag.

Andre Polykanine
  • 3,291
  • 18
  • 28