Issue #2158 - Part 5: Guard preload links support with a preference

This is enabled by default.
This commit is contained in:
FranklinDM 2024-01-27 12:02:10 +08:00 committed by roytam1
commit 6c53117699
4 changed files with 24 additions and 1 deletions

View file

@ -230,7 +230,7 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace,
mSpeculativeLoadQueue.AppendElement()->InitPreconnect(
url, crossOrigin);
}
} else if (rel.LowerCaseEqualsASCII("preload")) {
} else if (rel.LowerCaseEqualsASCII("preload") && nsContentUtils::IsPreloadEnabled()) {
nsHtml5String url =
aAttributes->getValue(nsHtml5AttributeName::ATTR_HREF);
if (url) {