Bug 1844185 - Add a pref to optionally disable preconnect r=necko-reviewers,kershaw

We want to test with and without this feature, so expose it via pref.

Differential Revision: https://phabricator.services.mozilla.com/D184150
This commit is contained in:
Andrew Creskey 2023-07-24 13:50:52 +00:00
parent a697b0c0d1
commit 41e9f1cf20
2 changed files with 11 additions and 0 deletions

View File

@ -12469,6 +12469,10 @@ void Document::MaybePreLoadImage(nsIURI* aUri,
}
void Document::MaybePreconnect(nsIURI* aOrigURI, mozilla::CORSMode aCORSMode) {
if (!StaticPrefs::network_preconnect()) {
return;
}
NS_MutateURI mutator(aOrigURI);
if (NS_FAILED(mutator.GetStatus())) {
return;

View File

@ -11704,6 +11704,13 @@
value: true
mirror: always
# Enables `<link rel="preconnect">` tag and `Link: rel=preconnect` response header
# handling.
- name: network.preconnect
type: RelaxedAtomicBool
value: true
mirror: always
# Enables `<link rel="modulepreload">` tag and `Link: rel=modulepreload`
# response header handling.
- name: network.modulepreload