mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 10:27:03 +00:00
Bug 1880374 - Disable DNS prefetching if document nodePrincipal is systemPrincipal r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D210830
This commit is contained in:
parent
6c87301889
commit
31308a6d79
@ -180,6 +180,13 @@ static bool EnsureDNSService() {
|
||||
}
|
||||
|
||||
bool HTMLDNSPrefetch::IsAllowed(Document* aDocument) {
|
||||
// Do not use prefetch if the document's node principal is the system
|
||||
// principal.
|
||||
nsCOMPtr<nsIPrincipal> principal = aDocument->NodePrincipal();
|
||||
if (principal->IsSystemPrincipal()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// There is no need to do prefetch on non UI scenarios such as XMLHttpRequest.
|
||||
return aDocument->IsDNSPrefetchAllowed() && aDocument->GetWindow();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user