Table of contents
- 1. Method overview
- 2. Attributes
- 3. Constants
- 4. Methods
- 4.1. doRestore()
- 5. See also
Handles the session restore process.
1.0
15.0
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. Requires Gecko 1.9 |
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. Requires Gecko 1.9 |
RECOVER_SESSION | 1 | The last session crashed. It will either be restored or about:sessionrestore will be displayed. Requires Gecko 1.9
|
RESUME_SESSION | 2 | The previous session should be restored at startup. Requires Gecko 1.9 |
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). Requires Gecko 2.0 |
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.


Mozilla Developer Network