Detect dummy group tab correctly even if it is still loading

This commit is contained in:
YUKI Hiroshi 2016-02-18 20:12:50 +09:00
parent a82d5adac8
commit c51112886a

View File

@ -2065,17 +2065,26 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, {
isGroupTab : function TSTBase_isGroupTab(aTab, aLazyCheck)
{
return aTab.linkedBrowser.currentURI.spec.indexOf('about:treestyletab-group') == 0;
return this.getLoadingURI(aTab).indexOf('about:treestyletab-group') == 0;
},
isTemporaryGroupTab : function TSTBase_isTemporaryGroupTab(aTab)
{
return (
this.isGroupTab(aTab) &&
/.*[\?&;]temporary=(?:1|yes|true)/i.test(aTab.linkedBrowser.currentURI.spec)
/.*[\?&;]temporary=(?:1|yes|true)/i.test(this.getLoadingURI(aTab))
);
},
getLoadingURI : function TSTBase_getLoadingURI(aTab)
{
var uri = aTab.linkedBrowser.currentURI;
if (uri.spec == 'about:blank' &&
aTab.linkedBrowser.userTypedValue)
return aTab.linkedBrowser.userTypedValue;
return uri.spec;
},
get pinnedTabsCount()
{
return this.browser.mTabContainer.querySelectorAll('tab[pinned="true"]').length;