Move style persistence from XULstore to SessionStore.
Follow up bug to fix persistence of sidebar when only a new tab is open and window is closed, and its
accompanying test `browser_sidebar_persist.js`: Bug 1898613
Depends on D207048
Differential Revision: https://phabricator.services.mozilla.com/D207787
* Timestamped log files are written to a `sessionstore-logs` directory in the profile directory
* Errors will always get written to disk, the logOnSuccess pref ensures all logs are saved even if no error has been captured
* The prefs configure how much logging we do. We have more verbose logging by default in nightly/early-beta, and less (errors, warnings) in release.
* Logging statements have been added to the early phases of session restore. We'll add more I'm sure as we troubleshoot specific bugs.
Differential Revision: https://phabricator.services.mozilla.com/D208816
Since we are moving away from XUL for the revamped sidebar, remove persistence off of XULstore.
For now, this involves moving persistence of "sidebar-command" and "positionend" to SessionStore.
A follow up bug 1892033 for moving the style attribute to SessionStore has been filed. This is slightly more involved,
hence the separate patch.
Differential Revision: https://phabricator.services.mozilla.com/D207048
The only tab attribute which is ever persisted by SessionStore is
"customizemode". This patch limits the logic to only allow persisting and
restoring this attribute.
The browser_attributes.js test is also updated to use the "customizemode"
attribute for testing, rather than a custom specified attribute.
Differential Revision: https://phabricator.services.mozilla.com/D205481
In bug 1804140, we shipped SHIP everywhere on desktop. Unfortunately, we
never removed the now-dead code from SessionStore.
This patch removes the easy to identify SessionStore code for non-SHIP,
now that it is a fully unsupported configuration.
Differential Revision: https://phabricator.services.mozilla.com/D205479
The only tab attribute which is ever persisted by SessionStore is
"customizemode". This patch limits the logic to only allow persisting and
restoring this attribute.
The browser_attributes.js test is also updated to use the "customizemode"
attribute for testing, rather than a custom specified attribute.
Differential Revision: https://phabricator.services.mozilla.com/D205481
In bug 1804140, we shipped SHIP everywhere on desktop. Unfortunately, we
never removed the now-dead code from SessionStore.
This patch removes the easy to identify SessionStore code for non-SHIP,
now that it is a fully unsupported configuration.
Differential Revision: https://phabricator.services.mozilla.com/D205479
These are only used right now for XUL notifications. They are extremely
weird (I bet there's tons of code that assume that WindowType::Popup
corresponds to nsMenuPopupFrame), and afaict there's no good reason why
these have to be this way.
They no longer are on Linux (because Wayland doesn't support such
thing for example).
XUL alerts work fine with this patch on all platforms after some basic
testing.
The other usage of this for the gfx sanity test can use type=dialog.
Actually it can just be a toplevel, but that breaks the XUL skeleton UI.
Differential Revision: https://phabricator.services.mozilla.com/D196665
These are only used right now for XUL notifications. They are extremely
weird (I bet there's tons of code that assume that WindowType::Popup
corresponds to nsMenuPopupFrame), and afaict there's no good reason why
these have to be this way.
They no longer are on Linux (because Wayland doesn't support such
thing for example).
XUL alerts work fine with this patch on all platforms after some basic
testing.
Depends on D196664
Differential Revision: https://phabricator.services.mozilla.com/D196665
* Add histogram to sessionrestore code to count how often and the number of
closed tabs that aren't saved on window close due to no open saveable tabs
* Add test coverage
Differential Revision: https://phabricator.services.mozilla.com/D193055
* Add histogram to sessionrestore code to count how often and the number of
closed tabs that aren't saved on window close due to no open saveable tabs
* Add test coverage
Differential Revision: https://phabricator.services.mozilla.com/D193055
* Change the signature for SessionStore.getClosedTabCount to accept either a window or options object
* Extend tests for the recently-closed-tabs menu(s)
* Add a test manifest to run the session/recently-closed tabs related extension tests with the
legacy (false) values for the all-windows and closed tabs from closed windows prefs
Differential Revision: https://phabricator.services.mozilla.com/D186400
* Add a browser.sessionstore.closedTabsFromClosedWindows pref and consult it when building recently-closed tab lists in firefoxview-next
* Add a _resolveClosedDataSource to SessionStore which allows us to find the window state and _closedTabs given a DOMWindow, a window closedId, or a window session store Id.
* Carry window closedId and source window Id into tab items when building recently-closed tab lists in firefoxview-next. This gives us the necessary context when we need to undoClose or forget a tab item in the list.
* Add a getClosed TabCount and TabData for Closed Windows method to SessionStore
* Modify undoCloseTab and forgetClosedTab to accept source params we can resolve to window state data using _resolveClosedDataSource
Differential Revision: https://phabricator.services.mozilla.com/D185108
* We already make use of the closedId in RecentlyClosedTabsInView to re-open the tab via SS.undoCloseById so it made sense to do the same for forgetting a closed tab
* In the test setup, one of tabs is opened and closed in a different window. This gives us coverage both for the closed tab list rendering, as well as re-opening and forgeting tabs with different source windows
* Both the forget-by-closed-id methods match undoClosedById's behavior and throw if the closedId doesnt match a closed window or tab
Differential Revision: https://phabricator.services.mozilla.com/D184192
* For cases where a user does not have automatic session restore enabled, recently closed
tabs will persist between sessions and previously open tabs will be added to the recently closed tabs
list; upon manual session restore, the previously open tabs will reopen and be removed from the closed tabs list
* Add marionette test and fix test bustages due to these changes.
Differential Revision: https://phabricator.services.mozilla.com/D178521
* Add a default-true pref to provide an escape hatch allowing us to revert to previous behavior
* in which recently-closed tabs are per-window,
* and undoing closed tabs restores them to the window they were closed from.
* Ensure we set the pref for tests which depend on its value
* Add some spot-checks in tests with the pref off
Differential Revision: https://phabricator.services.mozilla.com/D179574
* Menu Bar History menu recently-closed tab items includes closed tabs from all currently-open windows
* Toolbar/Appmenu history menu recently-closed tabs list includes closed tabs from all currently-open windows
* Firefox view recently-closed tab list includes closed tabs from all currently-open windows
* All recently-closed tab menu/items re-open in the current window
* Re-open all tabs menu item re-opens all tabs into the current window
* Ensure we filter out tabs without any useful state in firefox-view
* Add a target window argument to undoCloseTab and undoCloseById
* undoCloseTab will remove the tab data from the source window collection and re-open the tab into the target window
* Add an options argument to SessionStore.getWindows to get all private or non-private windows
* Add a getWindowForTabClosedId method on SessionStore, allowing look-up of the window associated with a closed tab
* Ensure recently-closed tab lists only include tabs from non-private windows when attached (i.e. opened from) a non-private window. And vice-versa.
* Update the sessionstore closed tab tests to assert on the new behavior
* Update the browser.sessions.restore implementation to always find and pass the source window when restoring a closed tab
* sessions.restore should always restore closed tabs to the source window as there's no implicit top or current window in the API context
Differential Revision: https://phabricator.services.mozilla.com/D174501