Index: chrome/ext/background.js |
=================================================================== |
--- a/chrome/ext/background.js |
+++ b/chrome/ext/background.js |
@@ -206,7 +206,14 @@ |
BrowserAction.prototype = { |
setIcon: function(path) |
{ |
- chrome.browserAction.setIcon({tabId: this._tabId, path: path}); |
+ var paths = {}; |
+ for (var i = 1; i <= 2; i++) |
+ { |
+ var size = i * 19; |
+ paths[size] = path.replace(/((?:.*\/)*.+?\b)/, '$1-' + size); |
Wladimir Palant
2014/04/02 16:37:24
This is rather non-obvious behavior. It should be
Sebastian Noack
2014/04/02 17:02:08
But then we would need something like |path.replac
Wladimir Palant
2014/04/03 05:43:40
No, path.replace("$size", "16") should do, the ico
Sebastian Noack
2014/04/03 11:42:26
I somewhat agree. Here you go.
|
+ } |
+ |
+ chrome.browserAction.setIcon({tabId: this._tabId, path: paths}); |
}, |
setBadge: function(badge) |
{ |