blob: ebc6f6f5ac07191fb8401ef15a177e50333cd813 [file] [log] [blame] [view]
dmazzoni2f489752017-02-16 03:39:161# ChromeVox (for developers)
2
3ChromeVox is the built-in screen reader on Chrome OS. It was originally
4developed as a separate extension but now the code lives inside of the Chromium
5tree and it's built as part of Chrome OS.
6
7To start or stop ChromeVox on Chrome OS, press Ctrl+Alt+Z at any time.
8
9## Developer Info
10
11Code location: ```chrome/browser/resources/chromeos/chromevox```
12
13Ninja target: it's built as part of "chrome", but you can build and run
14chromevox_tests to test it (Chrome OS target only - you must have target_os =
15"chromeos" in your GN args first).
16
17## Developing On Linux
18
19ChromeVox for Chrome OS development is done on Linux.
20
21See [ChromeVox on Desktop Linux](chromevox_on_desktop_linux.md)
22for more information.
23
24## ChromeVox Next
25
26ChromeVox Next is the code name we use for a major new rewrite to ChromeVox that
27uses the automation API instead of content scripts. The code is part of
28ChromeVox (unique ChromeVox Next code is found in
29chrome/browser/resources/chromeos/chromevox/cvox2).
30
31ChromeVox contains all of the classic and next code in the same codebase, it
32switches its behavior dynamically based on the mode:
33
34* Next: as of version 56 of Chrome/Chrome OS, this is default. ChromeVox uses new key/braille bindings, earcons, speech/braille output style, the Next engine (Automation API), and other major/minor improvements
35* Next Compat: in order to maintain compatibility with some clients of the ChromeVox Classic js APIs, some sites have been whitelisted for this mode. ChromeVox will inject classic content scripts, but expose a Next-like user experience (like above)
36* Classic: as of version 56 of Chrome/Chrome OS, this mode gets enabled via a keyboard toggle Search+Q. Once enabled, ChromeVox will behave like it did in the past including keyboard bindings, earcons, speech/braille output style, and the underlying engine (content scripts).
37* Classic compat for some sites that require Next, while running in Classic, ChromeVox will use the Next engine but expose a Classic user experience (like above)
38
39Once it's ready, the plan is to retire everything other than Next mode.
40
41## ChromeVox Next
42
43To test ChromeVox Next, click on the Gear icon in the upper-right of the screen
44to open the ChromeVox options (or press the keyboard shortcut Search+Shift+O, O)
45and then click the box to opt into ChromeVox Next.
46
47If you are running m56 or later, you already have ChromeVox Next on by
48default. To switch back to Classic, press Search+Q.
49
50## Debugging ChromeVox
51
52There are options available that may assist in debugging ChromeVox. Here are a
53few use cases.
54
55### Feature development
56
57When developing a new feature, it may be helpful to save time by not having to
58go through a compile cycle. This can be achieved by setting
59```chromevox_compress_js``` to 0 in
60chrome/browser/resources/chromeos/chromevox/BUILD.gn, or by using a debug build.
61
62In a debug build or with chromevox_compress_js off, the unflattened files in the
63Chrome out directory (e.g. out/Release/resources/chromeos/chromevox/). Now you
64can hack directly on the copy of ChromeVox in out/ and toggle ChromeVox to pick
65up your changes (via Ctrl+Alt+Z).
66
67### Fixing bugs
68
69The easiest way to debug ChromeVox is from an external browser. Start Chrome
70with this command-line flag:
71
72```out/Release/chrome --remote-debugging-port=9222```
73
74Now open http://localhost:9222 in a separate instance of the browser, and debug the ChromeVox extension background page from there.
75
76Another option is to use emacs jade (available through -mx
77package-list-packages).
78
79It also talks to localhost:9222 but integrates more tightly into emacs instead.
80
81Another option is to use the built-in developer console. Go to the
82ChromeVox options page with Search+Shift+o, o; then, substitute the
83“options.html” path with “background.html”, and then open up the
84inspector.
85
86### Running tests
87
88Build the chromevox_tests target. To run
89lots of tests in parallel, run it like this:
90
91```out/Release/chromevox_tests --test-launcher-jobs=20```
92
93Use a test filter if you only want to run some of the tests from a
94particular test suite - for example, most of the ChromeVox Next tests
95have "E2E" in them (for "end-to-end"), so to only run those:
96
97```out/Release/chromevox_tests --test-launcher-jobs=20 --gtest_filter="*E2E*"```
98
99## ChromeVox for other platforms
100
101ChromeVox can be run as an installable extension, separate from a
102linux Chrome OS build.
103
104### From source
105
106chrome/browser/resources/chromeos/chromevox/tools has the required scripts that pack ChromeVox as an extension and make any necessary manifest changes.
107
108### From Webstore
109
110Alternatively, the webstore has the stable version of ChromeVox.
111
112To install without interacting with the webstore UI, place the
113following json block in
114/opt/google/chrome-unstable/extensions/kgejglhpjiefppelpmljglcjbhoiplfn.json
115
116```
117{
118"external_update_url": "https://clients2.google.com/service/update2/crx"
119}
120```
121
122If you're using the desktop Linux version of Chrome, we recommend you
123use Voxin for speech. Run chrome with: “google-chrome
124--enable-speech-dispatcher” and select a voice provided by the speechd
125package from the ChromeVox options page (ChromeVox+o, o). As of the
126latest revision of Chrome 44, speechd support has become stable enough
127to use with ChromeVox, but still requires the flag.
128
129In the ChromeVox options page, select the flat keymap and use sticky
130mode (double press quickly of insert) to emulate a modal screen
131reader.