diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index ca7a26eb4120..6a09dce6191f 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4069,11 +4069,11 @@ function updateUserContextUIVisibility() /** * Updates the User Context UI indicators if the browser is in a non-default context */ -function updateUserContextUIIndicator(browser) +function updateUserContextUIIndicator() { let hbox = document.getElementById("userContext-icons"); - let userContextId = browser.getAttribute("usercontextid"); + let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid"); if (!userContextId) { hbox.hidden = true; return; diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index cefb52213ad1..9ea754e1be73 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1217,7 +1217,7 @@ this._adjustFocusAfterTabSwitch(this.mCurrentTab); } - updateUserContextUIIndicator(gBrowser.selectedBrowser); + updateUserContextUIIndicator(); this.tabContainer._setPositionalAttributes(); @@ -4328,7 +4328,12 @@ tab.setUserContextId(data.userContextId); } - updateUserContextUIIndicator(browser); + // We don't want to update the container icon and identifier if + // this is not the selected browser. + if (browser == gBrowser.selectedBrowser) { + updateUserContextUIIndicator(); + } + break; } case "Findbar:Keypress": {