From 3663519efdfcf01d6717ade70b9ce56f935fa75b Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Wed, 19 Nov 2014 12:25:39 +0900 Subject: [PATCH] Return the current browser immediately if possible --- modules/base.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/base.js b/modules/base.js index e7709cc8..a38cceae 100644 --- a/modules/base.js +++ b/modules/base.js @@ -1262,6 +1262,9 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, { getBrowserFromTabBrowserElements : function TSTBase_getBrowserFromTabBrowserElements(aTarget) { + var currentBrowser = this.browser.selectedTab.linkedBrowser; + if (!aTarget) + return currentBrowser; if (aTarget == '[object XULElement]') { if (aTarget.localName == 'tab') return aTarget.linkedBrowser; @@ -1280,7 +1283,7 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, { if (tab) return tab.linkedBrowser; } - return this.browser.selectedTab.linkedBrowser; + return currentBrowser; }, /* get tab(s) */