emoving call to displayBrowserActionBadge in messagehandler and updating badge.js
This commit is contained in:
parent
0ce57b01ab
commit
e04a7b36cb
2 changed files with 3 additions and 8 deletions
|
@ -1,8 +1,8 @@
|
|||
const MAJOR_VERSIONS = ["2.3.0", "2.4.0"];
|
||||
const badge = {
|
||||
async init() {
|
||||
const currentWindow = await browser.windows.getCurrent();
|
||||
this.displayBrowserActionBadge(currentWindow.incognito);
|
||||
const showVersionIndicator = await browser.windows.getCurrent();
|
||||
this.displayBrowserActionBadge(showVersionIndicator);
|
||||
},
|
||||
|
||||
disableAddon(tabId) {
|
||||
|
@ -16,7 +16,7 @@ const badge = {
|
|||
browser.browserAction.setBadgeBackgroundColor({color: color});
|
||||
browser.browserAction.setBadgeText({text: text});
|
||||
}
|
||||
if(action==="remove") {
|
||||
if(action==="showVersionIndicator") {
|
||||
const ActionBadgesClickedStorage = await browser.storage.local.get({browserActionBadgesClicked: []});
|
||||
if (MAJOR_VERSIONS.indexOf(extensionInfo.version) > -1 &&
|
||||
ActionBadgesClickedStorage.browserActionBadgesClicked.indexOf(extensionInfo.version) < 0) {
|
||||
|
|
|
@ -177,11 +177,6 @@ const messageHandler = {
|
|||
|
||||
async onFocusChangedCallback(windowId) {
|
||||
assignManager.removeContextMenu();
|
||||
// browserAction loses background color in new windows ...
|
||||
// https://bugzil.la/1314674
|
||||
// https://github.com/mozilla/testpilot-containers/issues/608
|
||||
// ... so re-call displayBrowserActionBadge on window changes
|
||||
badge.displayBrowserActionBadge("remove");
|
||||
browser.tabs.query({active: true, windowId}).then((tabs) => {
|
||||
if (tabs && tabs[0]) {
|
||||
assignManager.calculateContextMenu(tabs[0]);
|
||||
|
|
Loading…
Add table
Reference in a new issue