Session Restore: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
(→‎Preferences: Changed link from http://mxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#750 to https://dxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#828 ref comment in account request)
 
(33 intermediate revisions by 15 users not shown)
Line 1: Line 1:
<div id="uvtrufth" style="overflow:auto;height:1px;">[http://www.naacpncnetwork.org/nzrpe/ designer handbag kate replica spade] [http://www.naacpncnetwork.org/dqspqvz/ wholesale replica coach handbag] [http://www.naacpncnetwork.org/uicohwsh/ coach signature replica handbag wholesale] [http://www.naacpncnetwork.org/maxrfq/ aaa replica handbag] [http://www.naacpncnetwork.org/aeafvtw/ aaa chloe handbag replica] [http://www.naacpncnetwork.org/pfsvvrhya/ aaa grade handbag replica] [http://www.naacpncnetwork.org/iuksk/ handbag lv replica wholesale] [http://www.naacpncnetwork.org/mrisc/ hermes handbag replica] [http://www.naacpncnetwork.org/rkesflccj/ cheap replica handbag] [http://www.naacpncnetwork.org/cbmizf/ cheap replica chanel handbag] [http://www.naacpncnetwork.org/inmjs/ cheap replica coach handbag] [http://www.naacpncnetwork.org/xubcc/ cheap wholesale replica handbag] [http://www.naacpncnetwork.org/bbvfpatd/ cheap designer replica handbag wholesale] [http://www.naacpncnetwork.org/jrpbdgkls/ replica chloe handbag] [http://www.naacpncnetwork.org/bndxgv/ chloe handbag paddington replica] [http://www.naacpncnetwork.org/hurdmfzwa/ chloe designer handbag replica] [http://www.naacpncnetwork.org/lajyiwkvp/ fendi replica handbag] [http://www.naacpncnetwork.org/iyvxqw/ fendi and gucci replica handbag] [http://www.naacpncnetwork.org/enievg/ wholesale designer replica handbag] [http://www.naacpncnetwork.org/zydofdkd/ replica designer handbag at wholesale prices] [http://www.naacpncnetwork.org/giunev/ wholesale replica handbag] [http://www.naacpncnetwork.org/kgyuj/ handbag wholesale replica watch] [http://www.naacpncnetwork.org/jdilfpjqx/ wholesale replica lv handbag] [http://www.naacpncnetwork.org/fvkfvmvp/ replica handbag wholesale price] [http://www.naacpncnetwork.org/kouyrc/ replica chanel handbag] [http://www.naacpncnetwork.org/xrisqzjo/ replica designer handbag chanel] [http://www.naacpncnetwork.org/hkuzsz/ discount chanel handbag replica] [http://www.naacpncnetwork.org/rhyfld/ handbag louis replica theda vuitton] [http://www.naacpncnetwork.org/pfvwbjdyy/ handbag louis replica shopping vuitton] [http://www.naacpncnetwork.org/fwnriugs/ bag image louis mirror replica vuitton] [http://www.naacpncnetwork.org/kpcqja/ bag designer diaper replica] [http://www.naacpncnetwork.org/cwomynr/ bag dior replica] [http://www.naacpncnetwork.org/sbcjjxjum/ bag christian dior replica] [http://www.naacpncnetwork.org/coadxfajn/ bag hermes replica] [http://www.naacpncnetwork.org/atkwzq/ bag birkin hermes replica] [http://www.naacpncnetwork.org/dncljzexb/ bag burberry replica] </div>''Please comment in the Talk page (use the Discussion tab above)''= Goals &amp; Objectives =After a forced restart, restore the user's workspace exactly as it was.= Overview =The state of various window, tab and user-data will be saved, and reloaded upon application start. The feature will be passive, reacting only to forced-restarts such as extension installation and crashes. This minimal implementation provides an unobtrusive user-experience while meeting the broadest use-cases. The API will provide a stable and intuitive base which power-user oriented extensions, or expanded features in future releases, can build upon.= Features =* Save data for each window and tab (P1)* Automatically restore the session data upon restarting from a forced closure (P1)* If post-crash, allow the user to choose whether to restore (P1)* Allow the user to "undo" closing a tab or window (P2)= UI =* Prompt for restore upon application start, post-crash.<center>http://static.flickr.com/51/143165490_72557bc74c.jpg</center>= Usage and Configuration =The default settings will restore the session after a crash and previous history will be restored to a certain point.== Preferences ==* browser.sessionstore.enabled (bool) - Activate the service. Default is true* browser.sessionstore.resume_from_crash (bool) - Resume sessions post-crash. Default is true.* browser.sessionstore.resume_session_once (bool) - Resume session at the next application start, but not again. Default is false. This is used for restarting the browser after application updates and extension installation.* browser.startup.page = 3 - Resume sessions always. Default is 1 (open to the homepage at browser.startup.homepage)= Technical Design === Implementation ==The feature is implemented as an XPCOM service. It registers for events such as  windows and tab open/close, collects the current state of the browser, and periodically writes that state to disk.* Code location: http://lxr.mozilla.org/seamonkey/source/browser/components/sessionstore/== Data to be saved ==* All open windows and tabs* Width, height, and position of each window* Scroll position within each scrollable area in each window* Tab histories* Cookies* Text typed in forms* Restart downloads== API ==The API should allow session information to be easily accessed by extensions. An extension could store session info on a remote server, and allow users to restore the same session from multiple computers. This is currently a feature of the SessionSaver extension that doesn't really fit into the core browser.The API details and discussion are at [[SessionRestoreAPI]].= Privacy =Currently, the saved session data is cleared at shutdown, except in scenarios where the feature has been directed to intentionally save it, which are:* The application crashed* A forced restart, such as extension install or application update* The user has chosen to always resume sessionsThe saved session data is also cleared upon receiving the "browser:purge-session-history" notification.The data is stored on disk in JSON format. An open question is to whether this should be encrypted in some manner. See the Discussion page for more ideas about this.= To-do =* Implement undo close window* Implement user saving/loading of sessions* Can we use FastBack data to speed up undo close tab/window?= Unresolved Questions =* Storing cookies: Is it okay to persist cookies that are supposed to expire when the session ends? What about SSL cookies?* If we store cookies, should they also be stored when the user manually saves a session?* GET URLs: Bad things can happen if we reload a URL with a GET request that has side-effects. This has definitely been a problem for Google Web Accelerator.* <s>Do we ever want to store cached copies of the pages (i.e. for offline access) or do we just store the URLs and load them all? Loading from cache would be snappier. If any caching is done, should obey whatever caching directives.</s> - Pages are currently pulled from the browser cache, if available.* <s>Make sure that if the state of the current session crashes the browser, it doesn't reload at startup and crash over and over again. Look into how SessionSaver and Total Recall detect this.</s> - If the previous session crashed, the user is prompted with a choice as to whether to reload it.* If there are multiple windows open, how do we decide what was the last session?  The last window closed, or the last group of windows?* Should form state include saving checkbox and selectbox state as well as text input?= Misc === Relevant Bugs ==Current implementation:* [https://bugzilla.mozilla.org/show_bug.cgi?id=356050 bz356050]* [https://bugzilla.mozilla.org/show_bug.cgi?id=328154 bz328154] - Tracking bug for feature inclusion in Fx2Older:* [https://bugzilla.mozilla.org/show_bug.cgi?id=19454 bz19454]* [https://bugzilla.mozilla.org/show_bug.cgi?id=36810 bz36810]* [https://bugzilla.mozilla.org/show_bug.cgi?id=63094 bz63094]* [https://bugzilla.mozilla.org/show_bug.cgi?id=159357 bz159357]== Relevant Extensions==* MultiZilla's Tab Session Manager** http://multizilla.mozdev.org/features/session-manager.html* Session-Saver** http://forums.mozillazine.org/viewtopic.php?t=47184** http://kb.mozillazine.org/SessionSaver* [http://tmp.garyr.net/ Tab Mix Plus]* [http://forums.mozillazine.org/viewtopic.php?t=164513 Crash Recovery] / [http://forums.mozillazine.org/viewtopic.php?t=380534 Session Manager]* [http://recall.mozdev.org/ Total Recall]= Other Features =Some features that should be either P2, FF3 or left to extensions:* Allow the user to �save�? a particular session at any time, and load saved sessions either by default at startup or from a menu* Allow the user to choose which pages to restore, post-crash
''Please comment in the Talk page (use the Discussion tab above)''
 
= Goals & Objectives =
 
After a forced restart, restore the user's workspace exactly as it was.
 
= Overview =
 
The state of various window, tab and user-data will be saved, and reloaded upon application start. The feature will be passive, reacting only to forced-restarts such as extension installation and crashes. This minimal implementation provides an unobtrusive user-experience while meeting the broadest use-cases. The API will provide a stable and intuitive base which power-user oriented extensions, or expanded features in future releases, can build upon.
 
= Features =
 
* Save data for each window and tab (P1)
* Automatically restore the session data upon restarting from a forced closure (P1)
* If post-crash, allow the user to choose whether to restore (P1)
* Allow the user to "undo" closing a tab or window (P2)
 
= UI =
 
* Prompt for restore upon application start, post-crash.
<center>
http://static.flickr.com/51/143165490_72557bc74c.jpg
</center>
 
= Usage and Configuration =
 
The default settings will restore the session after a crash and previous history will be restored to a certain point.
 
== Preferences ==
 
See [https://dxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#828 the source] for currently available settings and their default values.
 
* browser.sessionstore.enabled (bool) - Activate the service. Default is true. May not appear in about:config until changed. Valid for Firefox 2 and 3, superseded since Version 3.5.
* browser.sessionstore.interval (integer) - minimal interval between saving  operations in milliseconds. Default is 10000.
* browser.sessionstore.max_resumed_crashes (integer) - Number of crashes that can occur before the about:sessionrestore page is displayed. Default is 1. So the user is asked after the second crash which pages he wants to restore.
* browser.sessionstore.resume_from_crash (bool) - Resume sessions post-crash. Default is true.
* browser.sessionstore.resume_session_once (bool) - Resume session at the next application start, but not again. Default is false. This is used for restarting the browser after application updates and extension installation.
* browser.startup.page (int) - What is displayed when Browser starts: 0 = blank page; 1 = homepage; 3 = previous session. Default is 1. (Note: Firefox exposes this preference in the Startup section of the Main pane of the Options/Preferences dialog.)
 
= Technical Design =
 
== Implementation ==
 
The feature is implemented as an XPCOM service. It registers for events such as  windows and tab open/close, collects the current state of the browser, and periodically writes that state to disk.
 
* Code location: http://lxr.mozilla.org/seamonkey/source/browser/components/sessionstore/
* Data location: File sessionstore.js in profile directory, backup in sessionstore.bak
 
== Data to be saved ==
 
* All open windows and tabs
* Width, height, and position of each window
* Scroll position within each scrollable area in each window
* Tab histories
* Cookies
* Text typed in forms
* Restart downloads
 
== API ==
 
The API should allow session information to be easily accessed by extensions.  An extension could store session info on a remote server, and allow users to restore the same session from multiple computers. This is currently a feature of the SessionSaver extension that doesn't really fit into the core browser.
 
The API details and discussion are at [[SessionRestoreAPI]].
 
= Privacy =
 
Currently, the saved session data is cleared at shutdown, except in scenarios where the feature has been directed to intentionally save it, which are:
 
* The application crashed
* A forced restart, such as extension install or application update
* The user has chosen to always resume sessions
 
The saved session data is also cleared upon receiving the "browser:purge-session-history" notification.
 
The data is stored on disk as a serialized javascript data structure (though it's possible that it will be converted to JSON once that becomes natively supported by Gecko/Spidermonkey). An open question is to whether this should be encrypted in some manner. See the Discussion page for more ideas about this.
 
= To-do =
 
* Implement undo close window
* Implement user saving/loading of sessions
* Can we use FastBack data to speed up undo close tab/window?
 
= Unresolved Questions =
 
* Storing cookies: Is it okay to persist cookies that are supposed to expire when the session ends? What about SSL cookies?
 
* If we store cookies, should they also be stored when the user manually saves a session?
 
* GET URLs: Bad things can happen if we reload a URL with a GET request that has side-effects. This has definitely been a problem for Google Web Accelerator.
 
* <s>Do we ever want to store cached copies of the pages (i.e. for offline access) or do we just store the URLs and load them all? Loading from cache would be snappier. If any caching is done, should obey whatever caching directives.</s> - Pages are currently pulled from the browser cache, if available.
 
* <s>Make sure that if the state of the current session crashes the browser, it doesn't reload at startup and crash over and over again. Look into how SessionSaver and Total Recall detect this.</s> - If the previous session crashed, the user is prompted with a choice as to whether to reload it.
 
* If there are multiple windows open, how do we decide what was the last session?  The last window closed, or the last group of windows?
 
* Should form state include saving checkbox and selectbox state as well as text input?
 
= User-friendly documentation =
 
See this Knowledge Base entry:  http://support.mozilla.com/en-US/kb/Session+Restore
 
== Relevant Bugs ==
 
Current implementation:
 
* [https://bugzilla.mozilla.org/show_bug.cgi?id=356050 bz356050]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=328154 bz328154] - Tracking bug for feature inclusion in Fx2
* [https://bugzilla.mozilla.org/show_bug.cgi?id=343876 Session restore when all last sessions tabs were closed should obey user homepage choice for the initial blank tab]
Older:
 
* [https://bugzilla.mozilla.org/show_bug.cgi?id=19454 bz19454]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=36810 bz36810]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=63094 bz63094]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=159357 bz159357]
 
== Relevant Extensions==
 
* MultiZilla's Tab Session Manager
** http://multizilla.mozdev.org/features/session-manager.html
* Session-Saver
** http://forums.mozillazine.org/viewtopic.php?t=47184
** http://kb.mozillazine.org/SessionSaver
* [http://tmp.garyr.net/ Tab Mix Plus]
* [http://forums.mozillazine.org/viewtopic.php?t=164513 Crash Recovery] / [http://forums.mozillazine.org/viewtopic.php?t=380534 Session Manager]
* [http://recall.mozdev.org/ Total Recall]
 
= Other Features =
 
Some features that should be either P2, FF3 or left to extensions:
 
* Allow the user to �save�? a particular session at any time, and load saved sessions either by default at startup or from a menu
* Allow the user to choose which pages to restore, post-crash

Latest revision as of 08:32, 22 March 2020

Please comment in the Talk page (use the Discussion tab above)

Goals & Objectives

After a forced restart, restore the user's workspace exactly as it was.

Overview

The state of various window, tab and user-data will be saved, and reloaded upon application start. The feature will be passive, reacting only to forced-restarts such as extension installation and crashes. This minimal implementation provides an unobtrusive user-experience while meeting the broadest use-cases. The API will provide a stable and intuitive base which power-user oriented extensions, or expanded features in future releases, can build upon.

Features

  • Save data for each window and tab (P1)
  • Automatically restore the session data upon restarting from a forced closure (P1)
  • If post-crash, allow the user to choose whether to restore (P1)
  • Allow the user to "undo" closing a tab or window (P2)

UI

  • Prompt for restore upon application start, post-crash.

143165490_72557bc74c.jpg

Usage and Configuration

The default settings will restore the session after a crash and previous history will be restored to a certain point.

Preferences

See the source for currently available settings and their default values.

  • browser.sessionstore.enabled (bool) - Activate the service. Default is true. May not appear in about:config until changed. Valid for Firefox 2 and 3, superseded since Version 3.5.
  • browser.sessionstore.interval (integer) - minimal interval between saving operations in milliseconds. Default is 10000.
  • browser.sessionstore.max_resumed_crashes (integer) - Number of crashes that can occur before the about:sessionrestore page is displayed. Default is 1. So the user is asked after the second crash which pages he wants to restore.
  • browser.sessionstore.resume_from_crash (bool) - Resume sessions post-crash. Default is true.
  • browser.sessionstore.resume_session_once (bool) - Resume session at the next application start, but not again. Default is false. This is used for restarting the browser after application updates and extension installation.
  • browser.startup.page (int) - What is displayed when Browser starts: 0 = blank page; 1 = homepage; 3 = previous session. Default is 1. (Note: Firefox exposes this preference in the Startup section of the Main pane of the Options/Preferences dialog.)

Technical Design

Implementation

The feature is implemented as an XPCOM service. It registers for events such as windows and tab open/close, collects the current state of the browser, and periodically writes that state to disk.

Data to be saved

  • All open windows and tabs
  • Width, height, and position of each window
  • Scroll position within each scrollable area in each window
  • Tab histories
  • Cookies
  • Text typed in forms
  • Restart downloads

API

The API should allow session information to be easily accessed by extensions. An extension could store session info on a remote server, and allow users to restore the same session from multiple computers. This is currently a feature of the SessionSaver extension that doesn't really fit into the core browser.

The API details and discussion are at SessionRestoreAPI.

Privacy

Currently, the saved session data is cleared at shutdown, except in scenarios where the feature has been directed to intentionally save it, which are:

  • The application crashed
  • A forced restart, such as extension install or application update
  • The user has chosen to always resume sessions

The saved session data is also cleared upon receiving the "browser:purge-session-history" notification.

The data is stored on disk as a serialized javascript data structure (though it's possible that it will be converted to JSON once that becomes natively supported by Gecko/Spidermonkey). An open question is to whether this should be encrypted in some manner. See the Discussion page for more ideas about this.

To-do

  • Implement undo close window
  • Implement user saving/loading of sessions
  • Can we use FastBack data to speed up undo close tab/window?

Unresolved Questions

  • Storing cookies: Is it okay to persist cookies that are supposed to expire when the session ends? What about SSL cookies?
  • If we store cookies, should they also be stored when the user manually saves a session?
  • GET URLs: Bad things can happen if we reload a URL with a GET request that has side-effects. This has definitely been a problem for Google Web Accelerator.
  • Do we ever want to store cached copies of the pages (i.e. for offline access) or do we just store the URLs and load them all? Loading from cache would be snappier. If any caching is done, should obey whatever caching directives. - Pages are currently pulled from the browser cache, if available.
  • Make sure that if the state of the current session crashes the browser, it doesn't reload at startup and crash over and over again. Look into how SessionSaver and Total Recall detect this. - If the previous session crashed, the user is prompted with a choice as to whether to reload it.
  • If there are multiple windows open, how do we decide what was the last session? The last window closed, or the last group of windows?
  • Should form state include saving checkbox and selectbox state as well as text input?

User-friendly documentation

See this Knowledge Base entry: http://support.mozilla.com/en-US/kb/Session+Restore

Relevant Bugs

Current implementation:

Older:

Relevant Extensions

Other Features

Some features that should be either P2, FF3 or left to extensions:

  • Allow the user to �save�? a particular session at any time, and load saved sessions either by default at startup or from a menu
  • Allow the user to choose which pages to restore, post-crash