Bug 1675097 - Use the correct sandboxing flags for initial about:blank r=asuth,smaug

Differential Revision: https://phabricator.services.mozilla.com/D99237
This commit is contained in:
Yaron Tausky
2020-12-16 13:06:56 +00:00
parent e7f2b98aed
commit 31293229ae
3 changed files with 7 additions and 1 deletions

View File

@@ -6643,7 +6643,10 @@ nsresult nsDocShell::CreateAboutBlankContentViewer(
if (docFactory) {
nsCOMPtr<nsIPrincipal> principal, partitionedPrincipal;
uint32_t sandboxFlags = mBrowsingContext->GetSandboxFlags();
const uint32_t sandboxFlags =
mBrowsingContext->GetHasLoadedNonInitialDocument()
? mBrowsingContext->GetSandboxFlags()
: mBrowsingContext->GetInitialSandboxFlags();
// If we're sandboxed, then create a new null principal. We skip
// this if we're being created from WindowGlobalChild, since in
// that case we already have a null principal if required.