| Index: ext/background.js |
| =================================================================== |
| --- a/ext/background.js |
| +++ b/ext/background.js |
| @@ -343,16 +343,24 @@ |
| { |
| // Edge throws if passed icon sizes different than 19,20,38,40px. |
| delete path[16]; |
| delete path[32]; |
| return browser.browserAction.setIcon({tabId: this._tabId, path}); |
| } |
| } |
| + if (change == "iconImageData" && "setIcon" in browser.browserAction) |
| + { |
| + return browser.browserAction.setIcon({ |
| + tabId: this._tabId, |
| + imageData: this._changes.iconImageData |
| + }); |
| + } |
| + |
| // There is no badge on Firefox for Android; the browser action is |
| // simply a menu item. |
| if (change == "badgeText" && "setBadgeText" in browser.browserAction) |
| return browser.browserAction.setBadgeText({ |
| tabId: this._tabId, |
| text: this._changes.badgeText |
| }); |
| @@ -392,20 +400,24 @@ |
| { |
| // If the tab is prerendered, browser.browserAction.set* fails |
| // and we have to delay our changes until the currently visible tab |
| // is replaced with the prerendered tab. |
| browser.tabs.onReplaced.addListener(onReplaced); |
| }); |
| } |
| }, |
| - setIcon(path) |
| + setIconPath(path) |
| { |
| this._addChange("iconPath", path); |
| }, |
| + setIconImageData(imageData) |
| + { |
| + this._addChange("iconImageData", imageData); |
| + }, |
| setBadge(badge) |
| { |
| if (!badge) |
| { |
| this._addChange("badgeText", ""); |
| } |
| else |
| { |