diff options
author | justinlin@chromium.org <justinlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-24 03:24:38 +0000 |
---|---|---|
committer | justinlin@chromium.org <justinlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-24 03:24:38 +0000 |
commit | 8aaa01be20860bc7f91d1d98ff8ad63a772934e6 (patch) | |
tree | 6b68f0496ad8737dc9181dc87d4cf5f9532a8e7c /chrome/renderer | |
parent | 45ae2778fdb7bb08d62b490b450eb87e735f6cce (diff) | |
download | chromium_src-8aaa01be20860bc7f91d1d98ff8ad63a772934e6.zip chromium_src-8aaa01be20860bc7f91d1d98ff8ad63a772934e6.tar.gz chromium_src-8aaa01be20860bc7f91d1d98ff8ad63a772934e6.tar.bz2 |
Mark window parameter for chrome.browserAction.openPopup as optional since it is not provided when opening a popup fails.
Don't throw exception when openPopup fails to get the popup window.
BUG=305737
Review URL: https://codereview.chromium.org/32283005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230617 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/resources/extensions/browser_action_custom_bindings.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js index 9a9fae0..9bec48b 100644 --- a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js +++ b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js @@ -19,14 +19,15 @@ binding.registerCustomHook(function(bindingsAPI) { apiFunctions.setCustomCallback('openPopup', function(name, request, response) { - if (chrome.runtime.lastError) - throw new Error(chrome.runtime.lastError.message); - if (!request.callback) return; - var views = getExtensionViews(-1, 'POPUP'); - request.callback(views.length > 0 ? views[0] : null); + if (chrome.runtime.lastError) { + request.callback(); + } else { + var views = getExtensionViews(-1, 'POPUP'); + request.callback(views.length > 0 ? views[0] : null); + } request.callback = null; }); }); |