After the changes in this bug, about:blank loads triggered by chrome will
finish in a "web" content process, as they have an untrusted null principal
without a precursor. In a few places throughout the codebase, however, we
perform about:blank loads with the explicit expectation that they do not change
processes. This new remoteTypeOverride option allows the intended final process
to be explicitly specified in this situation.
For security & simplicity reasons, this new attribute is limited to only be
usable on system-principal triggered loads of about:blank in toplevel browsing
contexts.
Differential Revision: https://phabricator.services.mozilla.com/D120671
If one closes the last tab with the session restore enabled, it will re-open after restart.
Fix that by closing completely the tabs before the stop of the browser.
Differential Revision: https://phabricator.services.mozilla.com/D118270
If one closes the last tab with the session restore enabled, it will re-open after restart.
Fix that by closing completely the tabs before the stop of the browser.
Differential Revision: https://phabricator.services.mozilla.com/D118270
When we duplicate a tab, we don't need to have about:blank load in it, because
we are going to use restore mechanism to copy data into the new tab. If we
don't skip the superfluous load, the restoring process might race with the
loading of about:blank, and sometimes we might try to destroy the
WindowGlobalChild actor just as SessionStore is trying to restore docshell
capabilities for that tab resulting in a rejected promise in _restoreHistory
and `_restoreHistoryComplete` not getting called.
Differential Revision: https://phabricator.services.mozilla.com/D119313
When we duplicate a tab, we don't need to have about:blank load in it, because
we are going to use restore mechanism to copy data into the new tab. If we
don't skip the superfluous load, the restoring process might race with the
loading of about:blank, and sometimes we might try to destroy the
WindowGlobalChild actor just as SessionStore is trying to restore docshell
capabilities for that tab resulting in a rejected promise in _restoreHistory
and `_restoreHistoryComplete` not getting called.
Differential Revision: https://phabricator.services.mozilla.com/D119313
If we're destroying the frame loader of a replaced browsing context we'll end up
firing browser-shutdown-tabstate-updated for a tab that wasn't actually closed.
This results in us cleaning up Session Store state earlier than expected, which
means we drop future updates to SessionStoreInternal._closedTabs.
Fixes browser_sessionHistory.js, browser_async_remove_tab.js, and possibly
browser_491168.js for SHIP+BFCache.
Differential Revision: https://phabricator.services.mozilla.com/D117944
This does a few things:
1. Removes the `aImmediately` flag from the RequestSHistoryUpdate path, and
moves that responsibility to SessionStore
1. Simplifies how and when SessionStore calls SessionHistory.collectFromParent()
1. Attempts to clean-up SessionStore's SHistoryListener (again)
Differential Revision: https://phabricator.services.mozilla.com/D117230
Replaces the `isFinal` bit with a "browser-shutdown-tabstate-updated" observer
notification, which is fired after all frames in the document are flushed.
Differential Revision: https://phabricator.services.mozilla.com/D116146
A previous patch made it so we'd fire this after the full restore finished, but
some consumers expect this event prior to the completion of the load.
Differential Revision: https://phabricator.services.mozilla.com/D114001
This also makes it so that we will never fire SSTabRestored without first having
sent the associated SSTabRestoring event.
Differential Revision: https://phabricator.services.mozilla.com/D110335
With the removal of the SessionStore:RestoreDocShellState message, the epoch
will no longer be updated otherwise, so we should include it in the Flush
message to ensure that messages are not being dropped.
Differential Revision: https://phabricator.services.mozilla.com/D110334
This should help avoid message ordering issues in the next patches. To ensure
that we're not firing events too early, we now do a "full" restore even if we
don't have form or scroll data, including for about:blank URIs.
This also moves all restore state on the CanonicalBrowsingContext into a
separate `mRestoreState` struct.
Differential Revision: https://phabricator.services.mozilla.com/D110333
With the new "restore docshell state" codepath, we may be calling
updateTabLabelAndIcon() later than we did before, which means we may have
already set the tab label (in tabbrowser.init()), and it's incorrect to override
that label value with the session history entry's title.
Differential Revision: https://phabricator.services.mozilla.com/D111456
This also makes it so that we will never fire SSTabRestored without first having
sent the associated SSTabRestoring event.
Differential Revision: https://phabricator.services.mozilla.com/D110335
With the removal of the SessionStore:RestoreDocShellState message, the epoch
will no longer be updated otherwise, so we should include it in the Flush
message to ensure that messages are not being dropped.
Differential Revision: https://phabricator.services.mozilla.com/D110334
This should help avoid message ordering issues in the next patches. To ensure
that we're not firing events too early, we now do a "full" restore even if we
don't have form or scroll data, including for about:blank URIs.
This also moves all restore state on the CanonicalBrowsingContext into a
separate `mRestoreState` struct.
Differential Revision: https://phabricator.services.mozilla.com/D110333
We now create the listener after receiving a "browsing-context-did-set-embedder"
and destroy it after receiving "browsing-context-discarded".
Differential Revision: https://phabricator.services.mozilla.com/D110337
This does a few things:
1. Gets rid of the listener's `_sHistoryChanges` property, which is possible
because _sHistoryChanges == false <-> _fromIdx == kNoIndex.
2. Simplifies the code that interacts with SHistoryListener in
UpdateSessionStoreFromTablistener, and attempts to make that function a
little more readable.
3. Ensures we're only doing the SessionHistory bit of
UpdateSessionStoreFromTablistener for toplevel frames, and if SHIP is
enabled.
Differential Revision: https://phabricator.services.mozilla.com/D110336
We now create the listener after receiving a "browsing-context-did-set-embedder"
and destroy it after receiving "browsing-context-discarded".
Differential Revision: https://phabricator.services.mozilla.com/D110337
This cleans up the SHistoryListener class and does a few things:
1. Gets rid of the listener's `_sHistoryChanges` property, which is possible
because _sHistoryChanges == false <-> _fromIdx == kNoIndex.
2. Simplifies the code that interacts with SHistoryListener in
UpdateSessionStoreFromTablistener, and attempts to make that function a
little more readable.
3. Ensures we're only doing the SessionHistory bit of
UpdateSessionStoreFromTablistener for toplevel frames.
Differential Revision: https://phabricator.services.mozilla.com/D110336
Re-order calls in SessionStore.jsm to invoke the side-effect-free logic
before triggering observable events.
Clear (likely) stale value of the cached currentURI when lazy browsers
are swapped.
And while I was at it, I also fixed a bug that caused a lazy browser to
eagerly be unlazified because the unneeded mute() call on a lazy browser
unlazifies it (discovered when I added complete test coverage for this
change).
Differential Revision: https://phabricator.services.mozilla.com/D108260
Instead of collecting data from the entire tree of documents, we
collect data per document. The collected data is sent to the
corresponding parent window context and is applied incrementally to
the tab state cache.
Differential Revision: https://phabricator.services.mozilla.com/D107814
Instead of collecting data from the entire tree of documents, we
collect data per document. The collected data is sent to the
corresponding parent window context and is applied incrementally to
the tab state cache.
Differential Revision: https://phabricator.services.mozilla.com/D107814