From 631780ff242f2b3b0903a3da4305d9f59181d2f9 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 25 Aug 2009 09:20:15 +0100 Subject: [PATCH] Bug 512245 Implement tab persist for content tabs. r=asuth --- mail/base/content/specialTabs.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mail/base/content/specialTabs.js b/mail/base/content/specialTabs.js index 24911cf743..ada88c6257 100644 --- a/mail/base/content/specialTabs.js +++ b/mail/base/content/specialTabs.js @@ -126,7 +126,7 @@ var specialTabs = { // Now start loading the content. aTab.title = this.loadingTabString; - aTab.browser.setAttribute("src", aContentPage); + aTab.browser.loadURI(aContentPage); this.lastBrowserId++; }, @@ -142,6 +142,18 @@ var specialTabs = { showTab: function onShowTab(aTab) { aTab.browser.setAttribute("type", "content-primary"); }, + persistTab: function onPersistTab(aTab) { + if (aTab.browser.currentURI.spec == "about:blank") + return null; + + return { + tabURI: aTab.browser.currentURI.spec + }; + }, + restoreTab: function onRestoreTab(aTabmail, aPersistedState) { + aTabmail.openTab("contentTab", { contentPage: aPersistedState.tabURI, + background: true } ); + }, onTitleChanged: function onTitleChanged(aTab) { aTab.title = aTab.browser.contentDocument.title; },