Skip to content

Commit dbad5d1

Browse files
committed
Bug 2004407 - Get policy container for initial about:blank from entry global. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D275622
1 parent 9432118 commit dbad5d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

toolkit/components/windowwatcher/nsWindowWatcher.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -959,10 +959,12 @@ nsresult nsWindowWatcher::OpenWindowInternal(
959959
activeDocsSandboxFlags = parentDoc->GetSandboxFlags();
960960

961961
if (!aForceNoOpener) {
962-
openWindowInfo->mPolicyContainerToInheritForAboutBlank =
963-
parentDoc->GetPolicyContainer();
964-
openWindowInfo->mCoepToInheritForAboutBlank =
965-
parentDoc->GetEmbedderPolicy();
962+
if (Document* entryDoc = GetEntryDocument()) {
963+
openWindowInfo->mPolicyContainerToInheritForAboutBlank =
964+
entryDoc->GetPolicyContainer();
965+
openWindowInfo->mCoepToInheritForAboutBlank =
966+
entryDoc->GetEmbedderPolicy();
967+
}
966968
}
967969

968970
// Check to see if this frame is allowed to navigate, but don't check if

0 commit comments

Comments
 (0)