Document the events and notifications Session Restore broadcasts
Categories
(Firefox :: Session Restore, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox158 | --- | fixed |
People
(Reporter: dao, Assigned: dao)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
Add a page to the Session Restore docs covering the DOM events and observer notifications the component broadcasts. The generated API reference documents none of them, since they are dispatchEvent and notifyObservers calls rather than class members, so the only way to learn the vocabulary today is to grep.
SessionStore.sys.mjs dispatches seven events -- SSWindowClosing, SSWindowStateBusy, SSWindowStateReady, SSWindowRestoring, SSWindowRestored, SSTabRestoring and SSTabRestored -- and the component notifies nineteen observer topics across it, SessionStartup, SessionSaver, SessionFile and StartupPerformance. Part of the page's job is sorting what a consumer should listen to from what is internal or test-only.
What the page should answer:
- which event and which topic fires when, for a session restored at startup, a single window restored later, and a window being closed
SSTabRestoringvsSSTabRestored: the first is the tab's chrome (label, icon, session history), the second its contentsessionstore-closed-objects-changedandsessionstore-saved-tab-groups-changedfire a tick after the change, and the first is coalesced behind a dirty flag, so a consumer that closes a tab and readsgetClosedTabCountsynchronously sees the list from before the changesessionstore-state-readis an extension point rather than a signal: its subject is a mutablensISupportsStringholding the session JSON, and an observer that rewrites it changes what gets parsed- which topics are test-only:
sessionstore-debug-tab-restoredandsessionstore-domwindowclosed-handledare behindgDebuggingEnabled, andsessionstore-browser-state-restoredis the twin ofsessionstore-windows-restoredthatsetBrowserStatenotifies so a test restoring a session does not re-trigger the startup observers - what the component listens for that is API rather than lifecycle:
browser:purge-session-history,browser:purge-session-history-for-domainandclear-origin-attributes-data
sessionstore-windows-restored is the exception: browser/docs/BrowserStartup.md already covers its role as the tree's startup milestone and the races around it, so the page should say what Session Restore means by it and link there.
| Assignee | ||
Comment 1•2 months ago
|
||
Updated•2 months ago
|
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
Comment 3•2 months ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•