the Chromium logo

The Chromium Projects

Accessibility Inspect Tools

These cli tools are designed to help to debug accessibility problems in applications, primarily in web browsers.

* ax_dump_tree to inspect accessibility tree of application

* ax_dump_events to watch accessibility events fired by application

Prerequisites

You may be required to enable accessibility on your system. Depending on the application, you may also be required to run an assistive technology like a screen reader or use an application-specific runtime flag or flip a preference on in order to activate accessibility application-wide.

Mac

  1. Turn on Accessibility for Terminal in Security & Privacy System Preferences.
    • If you connect over SSH, then make sure to turn Accessibility on for sshd-keygen-wrapper as well
  2. Eithe
    • Start VoiceOver (`CMD+F5`) or
    • Use application specific flag/preference
      • Chrome/Chromium: use `--force-renderer-accessibility` runtime flag

For example, to enable accessibility in Chromium run:

Chromium.app/Contents/MacOS/Chromium --force-renderer-accessibility

Linux

Either

Windows

Either

ax_dump_tree tool

Helps to inspect accessibility trees of applications. Trees are dumped into console. To dump an accessible tree, run:

ax_dump_tree <options>

ax_dump_events tool

The tool logs into console accessibility events fired by application. To watch accessibility events, run:

ax_dump_events <options>

Options

Selectors

At your convenience the number of pre-defined application selectors are available:

You can also specify an application by its title:

ax_dump_tree --pattern=title

The pattern string can contain wildcards like * and ?. Note, you can use --pattern selector in conjunction with pre-defined selectors.

Alternatively you can dump a tree by HWND on Windows:

--pid=HWND

Note, to use a hex window handle prefix it with `0x`.

Or by application PID on Mac and Linux:

--pid=process_id

Filters

By default a pre-defined set of property filters is applied. If you want to tune up the output, then use --filters option which specifies a file containing filtering rules: --filters=absolute_path_to_filters.txt

The format of the file is a plain text where each line defines a property filter. The supported property filters are:

For example, @ALLOW:AXARIALive will add AXARIALive attributes to the result tree on mac. Also see example-tree-filters.txt in tools/accessibility/inspect for more examples.

Other options

Examples

To dump Edge accessible tree on Windows:

out\Default\ax_dump_tree --edge

To dump an accessible tree on Mac for a Firefox window having title containing ``mozilla``:

out/Default/ax_dump_tree --firefox --pattern=*mozilla*

To watch Chromium accessibility events on Linux:

out/Default/ax_dump_events --chromium

Build

autoninja -C out/Default ax_dump_tree ax_dump_events

The command generates ax_dump_tree and ax_dump_events executables in `out/Default` directory.