Merge pull request #181 from tophf/icon16px

Use 16/32px icon in new MD toolbar
This commit is contained in:
Jason Barnabe 2016-08-31 20:43:37 -05:00 committed by GitHub
commit c6df61b4e9
5 changed files with 8 additions and 1 deletions

BIN
16w.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

BIN
32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

BIN
32w.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

View File

@ -51,6 +51,8 @@
"options_page": "manage.html",
"browser_action": {
"default_icon": {
"16": "16w.png",
"32": "32w.png",
"19": "19w.png",
"38": "38w.png"
},

View File

@ -47,7 +47,12 @@ function updateIcon(tab, styles) {
var disableAll = "disableAll" in styles ? styles.disableAll : prefs.get("disableAll");
var postfix = styles.length == 0 || disableAll ? "w" : "";
chrome.browserAction.setIcon({
path: {19: "19" + postfix + ".png", 38: "38" + postfix + ".png"},
path: {
// Material Design 2016 new size is 16px
16: "16" + postfix + ".png", 32: "32" + postfix + ".png",
// Chromium forks or non-chromium browsers may still use the traditional 19px
19: "19" + postfix + ".png", 38: "38" + postfix + ".png",
},
tabId: tab.id
}, function() {
// if the tab was just closed an error may occur,