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

Unified Diff: chrome/renderer/resources/extensions/browser_action_custom_bindings.js

Issue 32283005: Mark window parameter for chrome.browserAction.openPopup as optional since it is not provided when … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lasterror Created 7 years, 2 months 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
Index: chrome/renderer/resources/extensions/browser_action_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/browser_action_custom_bindings.js b/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
index 9a9fae08eea5eea998faef958d0bc7d7e026d969..9bec48b1303a342c8a346830991c495af266b883 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;
});
});

Powered by Google App Engine
This is Rietveld 408576698