Bug 1263647 - When receiving a TabPreZombify event, send out a Tab:AudioPlayingChange message only if the tab is actually playing some audio. r=margaret
MozReview-Commit-ID: 7eAc2mNgM42
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4081,19 +4081,25 @@ Tab.prototype = {
Messaging.sendRequest({
type: "DOMTitleChanged",
tabID: this.id,
title: truncate(aEvent.target.title, MAX_TITLE_LENGTH)
});
break;
}
+ case "TabPreZombify": {
+ if (!this.playingAudio) {
+ return;
+ }
+ // Fall through to the DOMAudioPlayback events, so the
+ // audio playback indicator gets reset upon zombification.
+ }
case "DOMAudioPlaybackStarted":
- case "DOMAudioPlaybackStopped":
- case "TabPreZombify": {
+ case "DOMAudioPlaybackStopped": {
if (!Services.prefs.getBoolPref("browser.tabs.showAudioPlayingIcon") ||
!aEvent.isTrusted) {
return;
}
let browser = aEvent.originalTarget;
if (browser != this.browser) {
return;