browser/components/sessionstore/nsISessionStartup.idlScriptable
Handles the session restore process.
1.0
66
Introduced
Gecko 1.8
Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)

Implemented by: @mozilla.org/browser/sessionstartup;1. To use this service, use:

var sessionStartup = Components.classes["@mozilla.org/browser/sessionstartup;1"]
                     .getService(Components.interfaces.nsISessionStartup);

Method overview

boolean doRestore();

Attributes

Attribute Type Description
sessionType unsigned long The type of session being restored; this will be one of the Session type constants. Read only.
state jsval

The session state, as a JavaScript object. Read only.

Note: Prior to Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5), this was a string. It was changed in order to improve performance, which was suffering due to the need to parse and stringify the data.

Constants

Session type constants

Constant Value Description
NO_SESSION 0 There's no data available from the previous session.
RECOVER_SESSION 1 The last session crashed. It will either be restored or about:sessionrestore will be displayed.
RESUME_SESSION 2 The previous session should be restored at startup.
DEFER_SESSION 3 The previous session is viable but shouldn't be restored without explicit action (with the exception of app tabs, which are always restored in this case).

Methods

doRestore()

Determines whether or not there is a session to restore.

boolean doRestore();
Parameters

None.

Return value

true if the session should be restored, otherwise false.

See also