Commit 80f324fc authored by amistry's avatar amistry Committed by Commit bot

Ignore errors from chrome.tabs.executeScript.

BUG=427334

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

Cr-Commit-Position: refs/heads/master@{#302227}
parent 1e5bccdc
......@@ -164,7 +164,22 @@ cr.define('hotword', function() {
if (!this.isEligibleUrl_(tab.url))
return;
chrome.tabs.executeScript(tab.id, {'file': 'audio_client.js'});
chrome.tabs.executeScript(
tab.id,
{'file': 'audio_client.js'},
function(results) {
if (chrome.runtime.lastError) {
// Ignore this error. For new tab pages, even though the URL is
// reported to be chrome://newtab/, the actual URL is a
// country-specific google domain. Since we don't have permission
// to inject on every page, an error will happen when the user is
// in an unsupported country.
//
// The property still needs to be accessed so that the error
// condition is cleared. If it isn't, exectureScript will log an
// error the next time it is called.
}
});
},
/**
......
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