mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Issue #2158 - Part 5: Guard preload links support with a preference
This is enabled by default.
This commit is contained in:
parent
95490b25eb
commit
6c53117699
4 changed files with 24 additions and 1 deletions
|
|
@ -295,6 +295,7 @@ bool nsContentUtils::sGettersDecodeURLHash = false;
|
|||
bool nsContentUtils::sPrivacyResistFingerprinting = false;
|
||||
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
|
||||
bool nsContentUtils::sUseActivityCursor = false;
|
||||
bool nsContentUtils::sPreloadEnabled = true;
|
||||
|
||||
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
|
||||
|
||||
|
|
@ -633,6 +634,9 @@ nsContentUtils::Init()
|
|||
Preferences::AddBoolVarCache(&sUseActivityCursor,
|
||||
"ui.use_activity_cursor", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sPreloadEnabled,
|
||||
"network.preload", true);
|
||||
|
||||
Element::InitCCCallbacks();
|
||||
|
||||
nsCOMPtr<nsIUUIDGenerator> uuidGenerator =
|
||||
|
|
@ -4125,6 +4129,10 @@ void
|
|||
nsContentUtils::DispatchEventForPreloadURI(nsIDOMNode* aNode,
|
||||
nsContentPolicyType& aPolicyType)
|
||||
{
|
||||
if (!IsPreloadEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINode> domNode = do_QueryInterface(aNode);
|
||||
if (domNode && domNode->IsInComposedDoc()) {
|
||||
bool success = aPolicyType != nsIContentPolicy::TYPE_INVALID;
|
||||
|
|
@ -7396,6 +7404,12 @@ nsContentUtils::GPCEnabled()
|
|||
return nsContentUtils::sGPCEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
nsContentUtils::IsPreloadEnabled()
|
||||
{
|
||||
return nsContentUtils::sPreloadEnabled;
|
||||
}
|
||||
|
||||
mozilla::LogModule*
|
||||
nsContentUtils::DOMDumpLog()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue