зеркало из https://github.com/mozilla/pjs.git
Bug 515664 - when installing an addon, tabs should be restored on restart [r=mbrubeck]
This commit is contained in:
Родитель
82044fd4d7
Коммит
80d07abbf3
|
@ -117,6 +117,7 @@ pref("browser.sessionhistory.max_total_viewers", 1);
|
|||
pref("browser.sessionhistory.max_entries", 50);
|
||||
|
||||
/* session store */
|
||||
pref("browser.sessionstore.resume_session_once", false);
|
||||
pref("browser.sessionstore.resume_from_crash", true);
|
||||
pref("browser.sessionstore.resume_from_crash_timeout", 60); // minutes
|
||||
pref("browser.sessionstore.interval", 10000); // milliseconds
|
||||
|
|
|
@ -111,6 +111,12 @@ SessionStore.prototype = {
|
|||
// Disable crash recovery if it has been turned off
|
||||
if (!Services.prefs.getBoolPref("browser.sessionstore.resume_from_crash"))
|
||||
this._shouldRestore = false;
|
||||
|
||||
// Do we need to restore session just this once, in case of a restart?
|
||||
if (Services.prefs.getBoolPref("browser.sessionstore.resume_session_once")) {
|
||||
Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", false);
|
||||
this._shouldRestore = true;
|
||||
}
|
||||
},
|
||||
|
||||
observe: function ss_observe(aSubject, aTopic, aData) {
|
||||
|
@ -167,6 +173,10 @@ SessionStore.prototype = {
|
|||
this._loadState = STATE_QUITTING;
|
||||
break;
|
||||
case "quit-application":
|
||||
// If we are restarting, lets restore the tabs
|
||||
if (aData == "restart")
|
||||
Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true);
|
||||
|
||||
// Freeze the data at what we've got (ignoring closing windows)
|
||||
this._loadState = STATE_QUITTING;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче