Skip to content

Commit

Permalink
Add icon sizes to setIcon to match manifest browserAction
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-p committed May 22, 2017
1 parent 8dabef1 commit 19ba5b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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('[email protected]', function(install) {console.log(arguments); install.uninstall()});
```

3. Coordinate with AMO reviewers to allow the install/uninstall action. (Via IRC?)
Expand Down
10 changes: 8 additions & 2 deletions src/chrome/backgroundscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 19ba5b0

Please sign in to comment.