diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index f2f00710fd2c..8b56662aa369 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -2851,6 +2851,13 @@ newTab = true; } + // Mute audio immediately to improve perceived speed of tab closure. + if (aTab.hasAttribute("soundplaying")) { + // Don't persist the muted state as this wasn't a user action. + // This lets undo-close-tab return it to an unmuted state. + aTab.linkedBrowser.mute(true); + } + aTab.closing = true; this._removingTabs.push(aTab); this._visibleTabs = null; // invalidate cache diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index 132c4074631f..8d0c57905fe4 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -757,9 +757,12 @@ readonly="true"/> +