2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nsISessionStore keeps track of the current browsing state - i.e.
|
2014-01-14 09:21:48 -08:00
|
|
|
* tab history, cookies, scroll state, form data, and window features
|
2007-03-22 10:30:00 -07:00
|
|
|
* - and allows to restore everything into one window.
|
|
|
|
*/
|
|
|
|
|
2014-01-17 02:40:18 -08:00
|
|
|
[scriptable, uuid(934697e4-3807-47f8-b6c9-6caa8d83ccd1)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsISessionStartup: nsISupports
|
|
|
|
{
|
2012-12-19 17:04:26 -08:00
|
|
|
/**
|
|
|
|
* Return a promise that is resolved once initialization
|
|
|
|
* is complete.
|
|
|
|
*/
|
|
|
|
readonly attribute jsval onceInitialized;
|
|
|
|
|
2011-07-15 09:42:21 -07:00
|
|
|
// Get session state
|
|
|
|
readonly attribute jsval state;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
2013-11-19 11:57:46 -08:00
|
|
|
* Determines whether there is a pending session restore. Should only be
|
|
|
|
* called after initialization has completed.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
|
|
|
boolean doRestore();
|
2008-02-14 13:53:33 -08:00
|
|
|
|
2013-11-19 11:57:46 -08:00
|
|
|
/**
|
|
|
|
* Determines whether automatic session restoration is enabled for this
|
|
|
|
* launch of the browser. This does not include crash restoration, and will
|
|
|
|
* return false if restoration will only be caused by a crash.
|
|
|
|
*/
|
|
|
|
boolean isAutomaticRestoreEnabled();
|
|
|
|
|
2013-07-26 04:16:29 -07:00
|
|
|
/**
|
|
|
|
* Returns whether we will restore a session that ends up replacing the
|
|
|
|
* homepage. The browser uses this to not start loading the homepage if
|
|
|
|
* we're going to stop its load anyway shortly after.
|
|
|
|
*
|
|
|
|
* This is meant to be an optimization for the average case that loading the
|
|
|
|
* session file finishes before we may want to start loading the default
|
|
|
|
* homepage. Should this be called before the session file has been read it
|
|
|
|
* will just return false.
|
|
|
|
*/
|
|
|
|
readonly attribute bool willOverrideHomepage;
|
|
|
|
|
2008-02-14 13:53:33 -08:00
|
|
|
/**
|
2010-09-10 10:57:28 -07:00
|
|
|
* What type of session we're restoring.
|
|
|
|
* NO_SESSION There is no data available from the previous session
|
|
|
|
* RECOVER_SESSION The last session crashed. It will either be restored or
|
|
|
|
* about:sessionrestore will be shown.
|
|
|
|
* RESUME_SESSION The previous session should be restored at startup
|
|
|
|
* DEFER_SESSION The previous session is fine, but it shouldn't be restored
|
|
|
|
* without explicit action (with the exception of pinned tabs)
|
2008-02-14 13:53:33 -08:00
|
|
|
*/
|
|
|
|
const unsigned long NO_SESSION = 0;
|
|
|
|
const unsigned long RECOVER_SESSION = 1;
|
|
|
|
const unsigned long RESUME_SESSION = 2;
|
2010-09-10 10:57:28 -07:00
|
|
|
const unsigned long DEFER_SESSION = 3;
|
2008-02-14 13:53:33 -08:00
|
|
|
|
|
|
|
readonly attribute unsigned long sessionType;
|
2014-01-17 02:40:18 -08:00
|
|
|
readonly attribute bool previousSessionCrashed;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|