Bug 1744321 - Add IsInProcess() check while checking sandbox flags; r=nika

Differential Revision: https://phabricator.services.mozilla.com/D133073
This commit is contained in:
Edgar Chen
2021-12-10 18:56:42 +00:00
parent 9b3b2c34ba
commit be93614b77
5 changed files with 143 additions and 2 deletions

View File

@@ -1354,10 +1354,14 @@ bool BrowsingContext::IsSandboxedFrom(BrowsingContext* aTarget) {
}
// If SANDBOXED_TOPLEVEL_NAVIGATION_USER_ACTIVATION flag is not on, we are not
// sandboxed from our top if we have user interaction.
// sandboxed from our top if we have user interaction. We assume there is a
// valid transient user gesture interaction if this check happens in the
// target process given that we have checked in the triggering process
// already.
if (!(sandboxFlags & SANDBOXED_TOPLEVEL_NAVIGATION_USER_ACTIVATION) &&
mCurrentWindowContext &&
mCurrentWindowContext->HasValidTransientUserGestureActivation() &&
(!mCurrentWindowContext->IsInProcess() ||
mCurrentWindowContext->HasValidTransientUserGestureActivation()) &&
aTarget == Top()) {
return false;
}