diff --git a/src/js/background/badge.js b/src/js/background/badge.js index b9f19ac..72eafc5 100644 --- a/src/js/background/badge.js +++ b/src/js/background/badge.js @@ -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) { diff --git a/src/js/background/messageHandler.js b/src/js/background/messageHandler.js index 977d0b2..8775e6e 100644 --- a/src/js/background/messageHandler.js +++ b/src/js/background/messageHandler.js @@ -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]);