Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| index 5c5b4dfcd0a3c978021d6a122f9aa5eaa68e0f03..e3fab5d3202c9ed6a52cf17b1e2338eebc17d797 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| @@ -51,6 +51,14 @@ Background = function() { |
| this.whitelist_ = ['chromevox_next_test']; |
| /** |
| + * A list of site substring patterns to blacklist ChromeVox Classic, |
| + * putting ChromeVox into Compat mode. |
| + * @type {!Array<string>} |
| + * @private |
| + */ |
| + this.classicBlacklist_ = []; |
| + |
| + /** |
| * Regular expression for blacklisting classic. |
| * @type {RegExp} |
| * @private |
| @@ -1002,7 +1010,11 @@ Background.prototype = { |
| * @private |
| */ |
| isBlacklistedForClassic_: function(url) { |
| - return this.classicBlacklistRegExp_.test(url); |
| + if (this.classicBlacklistRegExp_.test(url)) |
| + return true; |
| + return this.classicBlacklist_.some(function(item) { |
| + return url.indexOf(item) != -1; |
| + }); |
| }, |
| /** |
| @@ -1075,6 +1087,11 @@ Background.prototype = { |
| target: 'next', |
| isClassicEnabled: isClassicEnabled |
| }); |
| + } else if (action == 'enableCompatForUrl') { |
| + var url = msg['url']; |
| + this.classicBlacklist_.push(url); |
|
David Tseng
2016/06/15 22:50:17
Should be a dictionary/set since we don't want dup
dmazzoni
2016/06/16 20:00:06
Done.
|
| + if (this.currentRange_ && this.currentRange_.start.node) |
| + this.refreshMode(this.currentRange_.start.node); |
| } else if (action == 'onCommand') { |
| this.onGotCommand(msg['command']); |
| } else if (action == 'flushNextUtterance') { |