Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/background.js

Issue 29793590: Issue 6490 - Wrap browser.browserAction.set* with Promise (Closed)
Patch Set: Created May 29, 2018, 11:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
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: ext/background.js
===================================================================
--- a/ext/background.js
+++ b/ext/background.js
@@ -318,24 +318,30 @@
19: this._changes.iconPath.replace("$size", "19"),
20: this._changes.iconPath.replace("$size", "20"),
32: this._changes.iconPath.replace("$size", "32"),
38: this._changes.iconPath.replace("$size", "38"),
40: this._changes.iconPath.replace("$size", "40")
};
try
{
- browser.browserAction.setIcon({tabId: this._tabId, path});
+ browser.browserAction.setIcon({tabId: this._tabId, path}, () =>
+ {
+ browser.runtime.lastError;
+ });
}
catch (e)
{
// Edge throws if passed icon sizes different than 19,20,38,40px.
delete path[16];
delete path[32];
- browser.browserAction.setIcon({tabId: this._tabId, path});
+ browser.browserAction.setIcon({tabId: this._tabId, path}, () =>
+ {
+ browser.runtime.lastError;
+ });
}
}
}
if ("badgeText" in this._changes)
{
// There is no badge on Firefox for Android; the browser action is
// simply a menu item.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld