Commit 5c11f184 authored by dtseng's avatar dtseng Committed by Commit bot

Wrap new API in a try-catch.

Since the webstore release cannot (at the moment) be tied to any particular version of Chrome, something like this is necessary to prevent us from crashing.

TEST=load into Chrome stable; verify we still come up talking.

Review URL: https://codereview.chromium.org/1514483006

Cr-Commit-Position: refs/heads/master@{#364471}
parent 004444d1
......@@ -42,8 +42,12 @@ LiveRegions = function(chromeVoxState) {
*/
this.liveRegionNodeSet_ = new WeakSet();
chrome.automation.addTreeChangeObserver(
'liveRegionTreeChanges', this.onTreeChange.bind(this));
// API only exists >= m49. Prevent us from crashing.
try {
chrome.automation.addTreeChangeObserver(
'liveRegionTreeChanges', this.onTreeChange.bind(this));
} catch (e) {
}
};
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment