Bug 1209689 - Only show about:tabcrashed for the selected tab. r=felipe
authorMike Conley <mconley@mozilla.com>
Wed, 28 Oct 2015 15:30:43 -0400
changeset 273747 88f0ef22ab78502203405e8da70d61e247f76dc2
parent 273746 e099a63d77b46dd9fc115210ca432b1c66ac1bc1
child 273748 6ee79ecb5b03dd205e5c3de00bdf0ab0f0128326
push id68366
push usercbook@mozilla.com
push dateMon, 23 Nov 2015 13:31:58 +0000
treeherdermozilla-inbound@eff4131a3e4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1209689
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1209689 - Only show about:tabcrashed for the selected tab. r=felipe
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4422,23 +4422,29 @@
           if (!event.isTrusted)
             return;
 
           let browser = event.originalTarget;
           let title = browser.contentTitle;
           let uri = browser.currentURI;
           let icon = browser.mIconURL;
 
-          this.updateBrowserRemotenessByURL(browser, "about:tabcrashed");
-
-          browser.setAttribute("crashedPageTitle", title);
-          browser.docShell.displayLoadError(Cr.NS_ERROR_CONTENT_CRASHED, uri, null);
-          browser.removeAttribute("crashedPageTitle");
           let tab = this.getTabForBrowser(browser);
-          tab.setAttribute("crashed", true);
+
+          if (this.selectedBrowser == browser) {
+            this.updateBrowserRemotenessByURL(browser, "about:tabcrashed");
+            browser.setAttribute("crashedPageTitle", title);
+            browser.docShell.displayLoadError(Cr.NS_ERROR_CONTENT_CRASHED, uri, null);
+            browser.removeAttribute("crashedPageTitle");
+            tab.setAttribute("crashed", true);
+          } else {
+            this.updateBrowserRemoteness(browser, false);
+            SessionStore.reviveCrashedTab(tab);
+          }
+
           tab.removeAttribute("soundplaying");
           this.setIcon(tab, icon);
         ]]>
       </handler>
       <handler event="DOMAudioPlaybackStarted">
         <![CDATA[
           if (!Services.prefs.getBoolPref("browser.tabs.showAudioPlayingIcon") ||
               !event.isTrusted)