This commit is contained in:
YUKI Hiroshi 2013-05-28 15:43:37 +09:00
parent 0c12ac3b29
commit 096830cf22
3 changed files with 43 additions and 4 deletions

View File

@ -928,7 +928,7 @@ var TreeStyleTabBase = {
if (data && if (data &&
data._tabStillLoading && data._tabStillLoading &&
aTab.getAttribute('busy') != 'true' && aTab.getAttribute('busy') != 'true' &&
aTab.linkedBrowser.__SS_restoreState != 1) !utils.isTabRestoring(aTab))
data._tabStillLoading = false; data._tabStillLoading = false;
}, },

View File

@ -936,7 +936,7 @@ TreeStyleTabBrowser.prototype = {
* XXX dirty hack!!! there is no way to know when the tab is readied to be restored... * XXX dirty hack!!! there is no way to know when the tab is readied to be restored...
*/ */
if (!aTab.linkedBrowser.__treestyletab__toBeRestored) if (!aTab.linkedBrowser.__treestyletab__toBeRestored)
aTab.linkedBrowser.__treestyletab__toBeRestored = !!aTab.linkedBrowser.__SS_restoreState; aTab.linkedBrowser.__treestyletab__toBeRestored = utils.isTabNotRestoredYet(aTab);
var b = aTab.linkedBrowser; var b = aTab.linkedBrowser;
if (!b.__treestyletab__stop) { if (!b.__treestyletab__stop) {
b.__treestyletab__stop = b.stop; b.__treestyletab__stop = b.stop;
@ -6305,7 +6305,7 @@ TreeStyleTabBrowser.prototype = {
var tabs = this.getAllTabs(this.mTabBrowser); var tabs = this.getAllTabs(this.mTabBrowser);
tabs = tabs.filter(function(aTab) { tabs = tabs.filter(function(aTab) {
return ( return (
aTab.linkedBrowser.__SS_restoreState && utils.isTabNotRestoredYet(aTab) &&
aTab.linkedBrowser.__treestyletab__toBeRestored && aTab.linkedBrowser.__treestyletab__toBeRestored &&
(!onlyVisible || !aTab.hidden) (!onlyVisible || !aTab.hidden)
); );

View File

@ -233,6 +233,45 @@ let TreeStyleTabUtils = {
catch(e) { catch(e) {
} }
return void(0); return void(0);
} },
isTabNotRestoredYet: function(aTab)
{
var browser = aTab.linkedBrowser;
// Firefox 25 and later. See: https://bugzilla.mozilla.org/show_bug.cgi?id=867142
if (this.TabRestoreStates &&
this.TabRestoreStates.has(browser))
return (
this.TabRestoreStates.isNeedsRestore(browser) ||
this.TabRestoreStates.isRestoring(browser)
);
return !!browser.__SS_restoreState;
},
isTabRestoring: function(aTab)
{
var browser = aTab.linkedBrowser;
// Firefox 25 and later. See: https://bugzilla.mozilla.org/show_bug.cgi?id=867142
if (this.TabRestoreStates &&
this.TabRestoreStates.has(browser))
return this.TabRestoreStates.isRestoring(browser);
return browser.__SS_restoreState == 1;
},
get TabRestoreStates() {
return this.SessionStoreNS.TabRestoreStates;
},
get SessionStoreNS() {
if (!this._SessionStoreNS)
try {
// resource://app/modules/sessionstore/SessionStore.jsm ?
this._SessionStoreNS = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm', {});
}
catch(e) {
this._SessionStoreNS = {};
}
}
return this._SessionStoreNS;
}
}; };