File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
toolkit/components/windowwatcher Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -959,10 +959,16 @@ nsresult nsWindowWatcher::OpenWindowInternal(
959959 activeDocsSandboxFlags = parentDoc->GetSandboxFlags ();
960960
961961 if (!aForceNoOpener) {
962+ // Inherit from the entry global, e.g. for window.open and fall
963+ // back to the parent, e.g. for link clicks.
964+ Document* creator = GetEntryDocument ();
965+ if (!creator) {
966+ creator = parentDoc;
967+ }
962968 openWindowInfo->mPolicyContainerToInheritForAboutBlank =
963- parentDoc ->GetPolicyContainer ();
969+ creator ->GetPolicyContainer ();
964970 openWindowInfo->mCoepToInheritForAboutBlank =
965- parentDoc ->GetEmbedderPolicy ();
971+ creator ->GetEmbedderPolicy ();
966972 }
967973
968974 // Check to see if this frame is allowed to navigate, but don't check if
You can’t perform that action at this time.
0 commit comments