Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2931)

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js

Issue 1514483006: Wrap new API in a try-catch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
index 42ed81c6ecda49ee7baa36469546fd4ec998cbe8..0269a5da1fa647a452088549c6bf0471511defcd 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
@@ -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) {
+ }
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698