From 19ba5b01c16db21078c3c9b03ed4eeef666884b5 Mon Sep 17 00:00:00 2001 From: Adam Pritchard Date: Sun, 21 May 2017 21:22:09 -0400 Subject: [PATCH] Add icon sizes to setIcon to match manifest browserAction --- README.md | 4 +++- src/chrome/backgroundscript.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53c5bc7d..c35d0d6c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,9 @@ This results in a cleaner migration for existing Firefox users. 2. Modify old version to detect if it's running on Firefox, prompt the user to install the new extension and uninstall the old extension. ``` - AddonManager.getInstallForURL('https://addons.mozilla.org/firefox/downloads/latest/markdown-here/addon-375281-latest.xpi', function(install) {console.log(arguments); install.install()}, 'application/x-xpinstall') + AddonManager.getInstallForURL('https://addons.mozilla.org/firefox/downloads/latest/markdown-here/addon-375281-latest.xpi', function(install) {console.log(arguments); install.install()}, 'application/x-xpinstall'); + + AddonManager.getAddonByID('markdown-here@adam.pritchard', function(install) {console.log(arguments); install.uninstall()}); ``` 3. Coordinate with AMO reviewers to allow the install/uninstall action. (Via IRC?) diff --git a/src/chrome/backgroundscript.js b/src/chrome/backgroundscript.js index 597ffe41..9c1c4372 100644 --- a/src/chrome/backgroundscript.js +++ b/src/chrome/backgroundscript.js @@ -95,8 +95,11 @@ chrome.runtime.onMessage.addListener(function(request, sender, responseCallback) tabId: sender.tab.id }); chrome.browserAction.setIcon({ path: { + "16": Utils.getLocalURL('/common/images/icon16-button-monochrome.png'), "19": Utils.getLocalURL('/common/images/icon19-button-monochrome.png'), - "38": Utils.getLocalURL('/common/images/icon38-button-monochrome.png') + "32": Utils.getLocalURL('/common/images/icon32-button-monochrome.png'), + "38": Utils.getLocalURL('/common/images/icon38-button-monochrome.png'), + "64": Utils.getLocalURL('/common/images/icon64-button-monochrome.png') }, tabId: sender.tab.id }); return false; @@ -108,8 +111,11 @@ chrome.runtime.onMessage.addListener(function(request, sender, responseCallback) tabId: sender.tab.id }); chrome.browserAction.setIcon({ path: { + "16": Utils.getLocalURL('/common/images/icon16-button-disabled.png'), "19": Utils.getLocalURL('/common/images/icon19-button-disabled.png'), - "38": Utils.getLocalURL('/common/images/icon38-button-disabled.png') + "32": Utils.getLocalURL('/common/images/icon32-button-disabled.png'), + "38": Utils.getLocalURL('/common/images/icon38-button-disabled.png'), + "64": Utils.getLocalURL('/common/images/icon64-button-disabled.png') }, tabId: sender.tab.id }); return false;