Граф коммитов

154 Коммитов

Автор SHA1 Сообщение Дата
Paul Zuehlcke 3cf0011c96 Bug 1762374 - Part 1: Add a Histogram to count amount of query parameters stripped per navigation. r=anti-tracking-reviewers,necko-reviewers,dragana,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D146592
2022-05-24 18:57:17 +00:00
Paul Zuehlcke ff73626bba Bug 1763660 - Enable query parameter stripping in Private Browsing Mode. r=anti-tracking-reviewers,necko-reviewers,timhuang,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D143760
2022-05-17 10:42:16 +00:00
Tim Huang 7e5160909f Bug 1760009 - Don't strip the URL query parameters if there is no triggering principal. r=smaug
In the case where the triggering principal doesn't exist, calling
nsDocShellLoadState::MaybeStripTrackerQueryStrings() will crash. It's
becuase we will access the triggering principal in the function.

The patch makes the function to return early if the triggering prinicpal
doesn't exist. In this case, we cannot decide if we need to strip the
URL because the information from the triggering principal is lacking.
Therefore, we can only return and don't strip the URL. Also, this can
avoid crashing Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D141594
2022-03-22 08:45:19 +00:00
Sean Feng 5283aecc5d Bug 1468476 - Make soft reload only force validates top level document r=necko-reviewers,nika,dragana,asuth
Currently, soft reload uses the `VALIDATE_ALWAYS` flag to not only
force revalidate the top level document, but also subresources.
This causes content to be refetched from the web even if there
are caches that are still valid and can be used.

Chrome already has such behaviour to not revalidate all resources.

Differential Revision: https://phabricator.services.mozilla.com/D122270
2021-10-28 16:11:56 +00:00
Peter Van der Beken 0cb68caed4 Bug 1729662 - UNED exam page flickers / reloads infinitely. r=smaug
When we navigate in history to the same entry that we're current at then we
actually do a reload. The problem is in the way we detect whether to do a reload
in the parent process.

If a page does a back and a forward one after the other in a script, then the
parent will calculate the index for the back and tell the child to load the
entry at that index. While the child is processing the load of that entry, the
BC in the parent process still has the same entry as its active entry (until the
child commits the load of the entry over IPC). The parent then processes the
forward, calculates the index for the forward and finds the entry at that index.
This is the same entry that we were at before doing anything, and so the same
entry as the active entry in the BC in the parent process. We used to compare
the entry that we're going to load with the active entry in the BC to determine
whether we're doing a reload, and so in this situation we would assume the
forward navigation was actually doing a reload. The child would reload the page,
and we'd run the script again and we'd end up in a reload loop.

Comparing the offset with 0 to determine whether we're doing a reload fixes this
issue.

Differential Revision: https://phabricator.services.mozilla.com/D126585
2021-10-04 15:01:30 +00:00
Alexandru Michis bb8b740837 Backed out changeset d25df1c9e0e2 (bug 1729662) for causing wpt failures in overlapping-navigations-and-traversals
CLOSED TREE
2021-09-30 14:31:50 +03:00
Peter Van der Beken a57818d127 Bug 1729662 - UNED exam page flickers / reloads infinitely. r=smaug
When we navigate in history to the same entry that we're current at then we
actually do a reload. The problem is in the way we detect whether to do a reload
in the parent process.

If a page does a back and a forward one after the other in a script, then the
parent will calculate the index for the back and tell the child to load the
entry at that index. While the child is processing the load of that entry, the
BC in the parent process still has the same entry as its active entry (until the
child commits the load of the entry over IPC). The parent then processes the
forward, calculates the index for the forward and finds the entry at that index.
This is the same entry that we were at before doing anything, and so the same
entry as the active entry in the BC in the parent process. We used to compare
the entry that we're going to load with the active entry in the BC to determine
whether we're doing a reload, and so in this situation we would assume the
forward navigation was actually doing a reload. The child would reload the page,
and we'd run the script again and we'd end up in a reload loop.

Comparing the offset with 0 to determine whether we're doing a reload fixes this
issue.

Differential Revision: https://phabricator.services.mozilla.com/D126585
2021-09-30 07:56:52 +00:00
Olli Pettay 0ca720d7a3 Bug 1725680, requested index should be used only by the nsSHistory (and related code in CanonicalBrowsingContext), r=peterv
Using requestedIndex on the child side is hard, because there are race conditions when a session history load is triggered
and at the same time a non-session history load commits a new active entry.

Differential Revision: https://phabricator.services.mozilla.com/D126619
2021-09-29 13:22:34 +00:00
Iulian Moraru 1bffda0bc3 Backed out changeset a399e91dd5c2 (bug 1729662) for causing wpt failures on cross-document-traversal-cross-document-traversal.html. 2021-09-28 19:14:02 +03:00
Peter Van der Beken ef6256101a Bug 1729662 - UNED exam page flickers / reloads infinitely. r=smaug
When we navigate in history to the same entry that we're current at then we
actually do a reload. The problem is in the way we detect whether to do a reload
in the parent process.

If a page does a back and a forward one after the other in a script, then the
parent will calculate the index for the back and tell the child to load the
entry at that index. While the child is processing the load of that entry, the
BC in the parent process still has the same entry as its active entry (until the
child commits the load of the entry over IPC). The parent then processes the
forward, calculates the index for the forward and finds the entry at that index.
This is the same entry that we were at before doing anything, and so the same
entry as the active entry in the BC in the parent process. We used to compare
the entry that we're going to load with the active entry in the BC to determine
whether we're doing a reload, and so in this situation we would assume the
forward navigation was actually doing a reload. The child would reload the page,
and we'd run the script again and we'd end up in a reload loop.

Comparing the offset with 0 to determine whether we're doing a reload fixes this
issue.

Differential Revision: https://phabricator.services.mozilla.com/D126585
2021-09-28 13:25:15 +00:00
Nika Layzell a50cefe2cf Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
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
2021-08-10 14:31:16 +00:00
Butkovits Atila 22fb2b6793 Backed out 8 changesets (bug 1650089) for causing Xpcshell failures on test_ext_redirects.js. CLOSED TREE
Backed out changeset ee763318d378 (bug 1650089)
Backed out changeset 24d7898ec4bd (bug 1650089)
Backed out changeset bcdd2f5c9840 (bug 1650089)
Backed out changeset 24a5bd7f97dd (bug 1650089)
Backed out changeset 1b8b4e939e82 (bug 1650089)
Backed out changeset a7a4f37a5d72 (bug 1650089)
Backed out changeset 78c012d4b071 (bug 1650089)
Backed out changeset e870508c1ddc (bug 1650089)
2021-08-06 04:35:52 +03:00
Nika Layzell 649f35f3a0 Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
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
2021-08-06 00:10:56 +00:00
Alexandru Michis 5ca72bfc53 Backed out 7 changesets (bug 1650089) for causing xpcshell failures in test_ext_cookieBehaviors.js
Backed out changeset 336d6eb2fc15 (bug 1650089)
Backed out changeset 283ba29cdbeb (bug 1650089)
Backed out changeset c470e4c65117 (bug 1650089)
Backed out changeset 8fc2f428694d (bug 1650089)
Backed out changeset 37e5185dae14 (bug 1650089)
Backed out changeset a26afdc56d91 (bug 1650089)
Backed out changeset 32e207558b3d (bug 1650089)
2021-08-04 12:32:07 +03:00
Nika Layzell 3d749ece7f Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
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
2021-08-03 18:17:54 +00:00
Noemi Erli 6cd9318b66 Backed out 7 changesets (bug 1650089) foe causing bustages in ProcessIsolation.cpp
Backed out changeset 4e73beb8872c (bug 1650089)
Backed out changeset 092451e931ce (bug 1650089)
Backed out changeset ca9ba60010c6 (bug 1650089)
Backed out changeset ee61b69ba556 (bug 1650089)
Backed out changeset 091c4efa36a7 (bug 1650089)
Backed out changeset dbdee40ef8a0 (bug 1650089)
Backed out changeset 54d12a4333a0 (bug 1650089)
2021-08-03 20:15:54 +03:00
Nika Layzell 78129583eb Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
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
2021-08-03 15:39:33 +00:00
Dorel Luca f8c23e7e7f Backed out 5 changesets (bug 1650089) for Browser-chrome failures in browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js. CLOSED TREE
Backed out changeset 26ddad079ad3 (bug 1650089)
Backed out changeset 5ae2b2641484 (bug 1650089)
Backed out changeset c5d267a1907c (bug 1650089)
Backed out changeset d9eeca699dec (bug 1650089)
Backed out changeset 8bb303f6831a (bug 1650089)
2021-07-29 05:53:31 +03:00
Nika Layzell d1a6052ca7 Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
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
2021-07-29 01:40:19 +00:00
Tim Huang e2b6812898 Bug 1706616 - Part 1: Add telemetry probe for query stripping. r=dimi,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D117006
2021-06-14 19:45:39 +00:00
Marian-Vasile Laza 610b0ee572 Backed out 2 changesets (bug 1706616) for causing failures in browser_urlQueryStringStripping_telemetry.js
CLOSED TREE

Backed out changeset 7979a6bdcdae (bug 1706616)
Backed out changeset 0d901239cc7a (bug 1706616)
2021-06-11 11:22:51 +03:00
Tim Huang eb7947462a Bug 1706616 - Part 1: Add telemetry probe for query stripping. r=dimi,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D117006
2021-06-11 07:28:15 +00:00
Marian-Vasile Laza 984c14aa1c Backed out 2 changesets (bug 1706616) for causing bc failures in browser_urlQueryStringStripping_telemetry.js
CLOSED TREE

Backed out changeset 443f5f8fe809 (bug 1706616)
Backed out changeset 8446bda339b7 (bug 1706616)
2021-06-10 14:37:09 +03:00
Tim Huang 497011260e Bug 1706616 - Part 1: Add telemetry probe for query stripping. r=dimi,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D117006
2021-06-10 08:20:27 +00:00
Tim Huang 55a6f082b6 Bug 1706615 - Part 8: Preserve the unstripped URI when doing a reload. r=smaug
To restore the stripped query parameters when ETP toggle has been set to
off, we preserve the current unstripped URI to the new loadState when
doing a reload. By doing this, it will redirect the channel back to the
unstripped URI because the loading channel is in the content blocking
allow list and it has a unstripped URI in its loadInfo.

Differential Revision: https://phabricator.services.mozilla.com/D116116
2021-06-02 19:46:22 +00:00
Tim Huang 5aaa42e8bf Bug 1706615 - Part 4: Preserve the original URI into unstrippedURI if query stripping happens for navigations. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116111
2021-06-02 19:46:21 +00:00
Tim Huang 99cf3b886d Bug 1706615 - Part 2: Add UnstrippedURI in the nsDocShellLoadState. r=smaug
This patch adds an attribute UnstrippedURI in the nsDocShellLoadState.
The attribute will be set if the query stripping was happening.
Otherwise, it will stay a nullptr. This attribute will be propagated to
the loadInfo, so that we can revert the query stripping in the parent
process if the loading URI is in the content blocking allow list. We can
only revert the query stripping in the parent process because we cannot
access the permission of the content blocking allow list of a
cross-origin domain. So, we can only carry the unstripped URI in the
loadInfo and perform a interal redirect to revert the query stripping.

Differential Revision: https://phabricator.services.mozilla.com/D116109
2021-06-02 19:46:20 +00:00
Tim Huang c57fed056b Bug 1706604 - Part 2: Strip the URI before create the channel in nsDocShell. r=smaug
The target query parameters will be stripped from the loading URI in
nsDocShell before creating the channel for the loading. We will only
strip the URI for top-level loading but not for frames. It's because
there is no need to strip frames if we've stripped in top-level already.

Differential Revision: https://phabricator.services.mozilla.com/D113843
2021-05-20 11:22:12 +00:00
Christoph Kerschbaumer e1c35fda94 Bug 1658924: Implement HTTPS-First and automatically fall back to http if secure top-level connection is not available r=necko-reviewers,JulianWels,mattwoodrow,dragana
Differential Revision: https://phabricator.services.mozilla.com/D111686
2021-04-13 17:43:12 +00:00
Emilio Cobos Álvarez 3e0cb7c68b Bug 1703289 - Make mixed content blocker use a session-persistent permission rather than ad-hoc code. r=ckerschb,smaug
This is more fission-compatible, and a lot simpler.

Differential Revision: https://phabricator.services.mozilla.com/D111480
2021-04-12 18:04:12 +00:00
Niklas Gögge ed5eaf624b Bug 1647128 - Detect webby navs caused by meta refreshes in IsUserTriggeredForSecFetchSite check r=necko-reviewers,ckerschb,valentin
Differential Revision: https://phabricator.services.mozilla.com/D108035
2021-03-17 11:42:55 +00:00
Emilio Cobos Álvarez 7508fffd89 Bug 1694927 - Don't allow location APIs to steal focus. r=smaug,hsivonen
The check was a bit too general it seems. Explicitly allow moving focus
for link clicks and window.open(), which are the things we have tests
for and care about moving focus.

Differential Revision: https://phabricator.services.mozilla.com/D107039
2021-03-03 15:44:59 +00:00
Nika Layzell 29c2d4d113 Bug 1682285 - Part 1: Split internal and external load flags, r=kmag,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D103364
2021-01-29 22:06:16 +00:00
Andi-Bogdan Postelnicu 8dcc17a525 Bug 1683532 - Make `docshell` buildable outside of `unified-build` environment. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D100205
2021-01-04 14:18:37 +00:00
Kris Maglione b68275373e Bug 1672479: Fix beforeunload handling in location.refresh under SHiP. r=peterv
Per spec, whenever a "beforeunload" event handler which would affect a
`location.reload()` call exists, it must be called before the `reload()` call
returns. If a handler requests to block the navigation and we choose to
display a confirmation prompt, that must also be displayed before the call
returns.

With session history in parent, though, that currently does not happen,
because `location.reload()` triggers an async IPC call to the parent process,
and only attempts the actual reload (and thus beforeunload dispatch and
prompting) once it returns, which is too late to affect the caller.

This patch changes the handling in this case to manually perform permit unload
checks before taking an async code path. This still leaves the opportunity for
session history handlers in the parent to cancel the load asynchronously, but
that doesn't violate any spec-defined behavior.

Differential Revision: https://phabricator.services.mozilla.com/D94354
2020-12-14 21:25:46 +00:00
Peter Van der Beken d8307942b8 Bug 1673702 - Wrong page loaded when reloading after navigating back across an eTLD+1 boundary. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D95408
2020-10-30 23:49:14 +00:00
Marco Bonardo 1019bbf009 Bug 1626016 - Remove createFixupURI and move postData inside URIFixupInfo. r=Gijs,geckoview-reviewers,preferences-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D93189
2020-10-13 10:20:16 +00:00
Mark Banner 3d9ea7d179 Bug 1375244 - Remove sync KeywordToURI and related IPC messages as they are no longer required. r=Gijs,mak,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D89486
2020-09-11 07:15:21 +00:00
Peter Van der Beken 8f72952fc3 Bug 1663488 - Fix CanonicalBrowsingContext::NotifyOnHistoryReload. r=smaug
Depends on D89421

Differential Revision: https://phabricator.services.mozilla.com/D89422
2020-09-08 14:04:33 +00:00
Nika Layzell 6d387b5d53 Bug 1658082 - Part 1: Correctly set mTargetBrowsingContext from IPC, r=mattwoodrow
Previously, this field was incorrectly being initialized to
SourceBrowsingContext instead of TargetBrowsingContext.

Differential Revision: https://phabricator.services.mozilla.com/D88321
2020-08-26 22:21:51 +00:00
Peter Van der Beken a4a8b3da89 Bug 1649131 - Implement history.pushState/.replaceState for session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D87039
2020-08-23 17:41:03 +00:00
Peter Van der Beken 1caf077d0b Bug 1649131 - Stop checking for an nsISHEntry in nsDocShellLoadState as a sign of a load from history. r=smaug
Checking for an nsISHEntry doesn't work anymore with session history in the
parent. For that we can check that the loading session history info's
mIsLoadFromSessionHistory is true. If there is no loading session history info
we can fall back to the old way of checking for a non-null nsISHEntry (which
will only ever be true if session history in the parent is turned off).

Differential Revision: https://phabricator.services.mozilla.com/D87037
2020-08-23 20:20:55 +00:00
Peter Van der Beken 4a9e44592e Bug 1649131 - Stop marking SessionHistoryInfo as moveonly. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D87036
2020-08-20 12:58:40 +00:00
Olli Pettay 0bd5beeadf Bug 1658821 - Move Id from SessionHistoryInfo to LoadingSessionHistoryInfo, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D86864
2020-08-20 16:55:21 +00:00
Butkovits Atila 5c5df0b663 Backed out changeset 24d6087acc64 (bug 1658821) for build bustage at SessionHistoryEntry.cpp. CLOSED TREE 2020-08-20 17:37:53 +03:00
Olli Pettay cd47973905 Bug 1658821 - Move Id from SessionHistoryInfo to LoadingSessionHistoryInfo, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D86864
2020-08-20 12:02:17 +00:00
Olli Pettay cadcd14bc8 Bug 1656996 - Ensure cross-process session history navigations update child process side index and length, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D85789
2020-08-14 13:05:25 +00:00
Csoregi Natalia 36ac6c5cca Backed out 2 changesets (bug 1656997, bug 1656996) for fission failures on browser_preferences_usage.js. CLOSED TREE
Backed out changeset c3aaa4f191e6 (bug 1656997)
Backed out changeset e41977f9608f (bug 1656996)
2020-08-14 00:47:56 +03:00
Olli Pettay 9b6fb243d1 Bug 1656996 - Ensure cross-process session history navigations update child process side index and length, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D85789
2020-08-13 19:17:08 +00:00
Olli Pettay 26b28f1b65 Bug 1654525 - Ensure loads initiated from session history in parent reuse the existing SHEntries, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D85173
2020-07-29 14:23:09 +00:00