Bug 1932555, a=RyanVM

Original Revision: https://phabricator.services.mozilla.com/D231928

Differential Revision: https://phabricator.services.mozilla.com/D234663
This commit is contained in:
Paul Zuehlcke 2025-01-18 17:10:55 +00:00
parent 14d6750744
commit 81d6efa641

View file

@ -5623,8 +5623,15 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
} }
// If we haven't found a chrome window to open in, just use the most recently // If we haven't found a chrome window to open in, just use the most recently
// opened one. // opened non PBM window.
if (!outerWin) { if (!outerWin) {
// The parent was a private window but it's no longer available.
if (aOriginAttributes.mPrivateBrowsingId !=
nsIScriptSecurityManager::DEFAULT_PRIVATE_BROWSING_ID) {
aResult = NS_ERROR_FAILURE;
return IPC_OK();
}
outerWin = nsContentUtils::GetMostRecentNonPBWindow(); outerWin = nsContentUtils::GetMostRecentNonPBWindow();
if (NS_WARN_IF(!outerWin)) { if (NS_WARN_IF(!outerWin)) {
aResult = NS_ERROR_FAILURE; aResult = NS_ERROR_FAILURE;