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:
Aidin Gharibnavaz
2015-09-05 09:15:00 +02:00
parent 0372b17850
commit 155c1b746b

View File

@@ -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));