Bug 827976 - browser-places.js doesn't need to get a reference to the hidden window. r=mak
authorFelipe Gomes <felipc@gmail.com>
Mon, 04 Mar 2019 18:53:03 +0000
changeset 520351 e4ff7ce962486dd21c4e4c8bd355f361b3a426de
parent 520350 2cc8de9e4c12f50485a080e21b6aa357d7f6ca2c
child 520352 51a46315f6603d062126204778e6d9f002998dc0
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");