Bug 1100154 - Ensure that targeted links in a private browsing window can't target non-private-browsing windows and vice versa. r=bz
This commit is contained in:
@@ -3420,6 +3420,14 @@ nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem,
|
||||
return false;
|
||||
}
|
||||
|
||||
// A private document can't access a non-private one, and vice versa.
|
||||
if (aTargetItem->GetDocument()->GetLoadContext()->UsePrivateBrowsing() !=
|
||||
aAccessingItem->GetDocument()->GetLoadContext()->UsePrivateBrowsing())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> accessingRoot;
|
||||
aAccessingItem->GetSameTypeRootTreeItem(getter_AddRefs(accessingRoot));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user