Bug 1681457 - Allow non-auxiliary BrowsingContexts created by script to close themselves, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211792
This commit is contained in:
@@ -1056,7 +1056,8 @@ nsresult ContentChild::ProvideWindowCommon(
|
||||
|
||||
RefPtr<BrowsingContext> browsingContext = BrowsingContext::CreateDetached(
|
||||
nullptr, openerBC, nullptr, aName, BrowsingContext::Type::Content,
|
||||
aIsPopupRequested);
|
||||
{.isPopupRequested = aIsPopupRequested,
|
||||
.topLevelCreatedByWebContent = true});
|
||||
MOZ_ALWAYS_SUCCEEDS(browsingContext->SetRemoteTabs(true));
|
||||
MOZ_ALWAYS_SUCCEEDS(browsingContext->SetRemoteSubframes(useRemoteSubframes));
|
||||
MOZ_ALWAYS_SUCCEEDS(browsingContext->SetOriginAttributes(
|
||||
@@ -1181,9 +1182,11 @@ nsresult ContentChild::ProvideWindowCommon(
|
||||
|
||||
if (aForceNoOpener || !parent) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!browsingContext->HadOriginalOpener());
|
||||
MOZ_DIAGNOSTIC_ASSERT(browsingContext->GetTopLevelCreatedByWebContent());
|
||||
MOZ_DIAGNOSTIC_ASSERT(browsingContext->GetOpenerId() == 0);
|
||||
} else {
|
||||
MOZ_DIAGNOSTIC_ASSERT(browsingContext->HadOriginalOpener());
|
||||
MOZ_DIAGNOSTIC_ASSERT(browsingContext->GetTopLevelCreatedByWebContent());
|
||||
MOZ_DIAGNOSTIC_ASSERT(browsingContext->GetOpenerId() == parent->Id());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user