Bug 827976 - browser-places.js doesn't need to get a reference to the hidden window. r=mak
☠☠ backed out by bf3cbcc82527 ☠ ☠
authorFelipe Gomes <felipc@gmail.com>
Fri, 01 Mar 2019 21:07:00 +0000
changeset 519900 e253b264e7bdfdf28bfb2f15ab0f22cded77d91c
parent 519899 07ef335770a8c0e985b9491c21882c658d458260
child 519901 fd94066a1d76d155a0edc9a2b9c67bac381fdf58
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs827976
milestone67.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 827976 - browser-places.js doesn't need to get a reference to the hidden window. r=mak Differential Revision: https://phabricator.services.mozilla.com/D21080
browser/base/content/browser-places.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -567,22 +567,22 @@ HistoryMenu.prototype = {
   _elements: {
     undoTabMenu: "historyUndoMenu",
     hiddenTabsMenu: "hiddenTabsMenu",
     undoWindowMenu: "historyUndoWindowMenu",
     syncTabsMenuitem: "sync-tabs-menuitem",
   },
 
   _getClosedTabCount() {
-    // SessionStore doesn't track the hidden window, so just return zero then.
-    if (window == Services.appShell.hiddenDOMWindow) {
+    try {
+      return SessionStore.getClosedTabCount(window);
+    } catch (ex) {
+      // SessionStore doesn't track the hidden window, so just return zero then.
       return 0;
     }
-
-    return SessionStore.getClosedTabCount(window);
   },
 
   toggleHiddenTabs() {
     if (window.gBrowser &&
         gBrowser.visibleTabs.length < gBrowser.tabs.length) {
       this.hiddenTabsMenu.removeAttribute("hidden");
     } else {
       this.hiddenTabsMenu.setAttribute("hidden", "true");