diff --git a/webextensions/common/Tab.js b/webextensions/common/Tab.js index 3b51d6ed3..4c03d8bc8 100644 --- a/webextensions/common/Tab.js +++ b/webextensions/common/Tab.js @@ -1131,12 +1131,6 @@ export default class Tab { this.states.add(state); switch (state) { - case Constants.kTAB_STATE_ACTIVE: - if (this.element && - this.element.parentNode) - this.element.parentNode.setAttribute('aria-activedescendant', this.element.id); - break; - case Constants.kTAB_STATE_HIGHLIGHTED: if (this.element) this.element.setAttribute('aria-selected', 'true'); diff --git a/webextensions/sidebar/sidebar-tabs.js b/webextensions/sidebar/sidebar-tabs.js index d7d4bbc30..5921ac61b 100644 --- a/webextensions/sidebar/sidebar-tabs.js +++ b/webextensions/sidebar/sidebar-tabs.js @@ -611,8 +611,13 @@ BackgroundConnection.onMessage.addListener(async message => { const tab = Tab.get(lastMessage.tabId); if (!tab) return; + const lastActive = TabsStore.activeTabInWindow.get(lastMessage.windowId); + if (lastActive && + lastActive.$TST.element) + lastActive.$TST.element.parentNode.removeAttribute('aria-activedescendant'); TabsStore.activeTabInWindow.set(lastMessage.windowId, tab); TabsInternalOperation.setTabActive(tab); + tab.$TST.element.parentNode.setAttribute('aria-activedescendant', tab.$TST.element.id); }; break; case Constants.kCOMMAND_NOTIFY_TAB_UPDATED: {