mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 22:08:40 +09:00
[Dom/network] Disable DNS prefetching if document nodePrincipal is systemPrincipal
This commit is contained in:
parent
68639a9347
commit
c94c6a5785
1 changed files with 8 additions and 1 deletions
|
|
@ -94,8 +94,15 @@ nsHTMLDNSPrefetch::Shutdown()
|
|||
}
|
||||
|
||||
bool
|
||||
nsHTMLDNSPrefetch::IsAllowed (nsIDocument *aDocument)
|
||||
nsHTMLDNSPrefetch::IsAllowed(nsIDocument *aDocument)
|
||||
{
|
||||
// Do not use prefetch if the document's node principal is the system
|
||||
// principal.
|
||||
nsCOMPtr<nsIPrincipal> principal = aDocument->NodePrincipal();
|
||||
if (nsContentUtils::IsSystemPrincipal(principal)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// There is no need to do prefetch on non UI scenarios such as XMLHttpRequest.
|
||||
return aDocument->IsDNSPrefetchAllowed() && aDocument->GetWindow();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue