Bug 479461 - Private browsing, close window, can't restore session; r=gavin a1.9.1=blocking-firefox3.1+

This commit is contained in:
Mike Connor 2009-02-27 23:55:04 +03:30
Родитель 36d4d0a3a5
Коммит f4d523ab1a
1 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -171,13 +171,19 @@ PrivateBrowsingService.prototype = {
let browser = Cc["@mozilla.org/appshell/window-mediator;1"]. let browser = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator). getService(Ci.nsIWindowMediator).
getMostRecentWindow("navigator:browser").gBrowser; getMostRecentWindow("navigator:browser");
// if all browser windows are closed (i.e. on Mac) we won't have a window here
// this is only needed on Mac, but it's just good hygiene
if (browser) {
// this ensures a clean slate from which to transition into or out of // this ensures a clean slate from which to transition into or out of
// private browsing // private browsing
browser = browser.gBrowser;
browser.addTab(); browser.addTab();
browser.removeTab(browser.tabContainer.firstChild); browser.removeTab(browser.tabContainer.firstChild);
} }
} }
}
else else
this._saveSession = false; this._saveSession = false;
}, },