tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit dbad5d1e6bb41cfe17061a0258a872ac7a642a8c
parent 94321182fd985cda19a7a4bdf77a352c9ce75125
Author: Vincent Hilla <vhilla@mozilla.com>
Date:   Tue,  9 Dec 2025 15:18:38 +0000

Bug 2004407 - Get policy container for initial about:blank from entry global. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D275622

Diffstat:
Mtoolkit/components/windowwatcher/nsWindowWatcher.cpp | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp @@ -959,10 +959,12 @@ nsresult nsWindowWatcher::OpenWindowInternal( activeDocsSandboxFlags = parentDoc->GetSandboxFlags(); if (!aForceNoOpener) { - openWindowInfo->mPolicyContainerToInheritForAboutBlank = - parentDoc->GetPolicyContainer(); - openWindowInfo->mCoepToInheritForAboutBlank = - parentDoc->GetEmbedderPolicy(); + if (Document* entryDoc = GetEntryDocument()) { + openWindowInfo->mPolicyContainerToInheritForAboutBlank = + entryDoc->GetPolicyContainer(); + openWindowInfo->mCoepToInheritForAboutBlank = + entryDoc->GetEmbedderPolicy(); + } } // Check to see if this frame is allowed to navigate, but don't check if