Add preference to allow the loading of FTP subresources.
This commit is contained in:
parent
351ddcc8da
commit
b30beb5771
|
@ -98,6 +98,9 @@ nsContentSecurityManager::CheckFTPSubresourceLoad(nsIChannel* aChannel)
|
||||||
// We dissallow using FTP resources as a subresource everywhere.
|
// We dissallow using FTP resources as a subresource everywhere.
|
||||||
// The only valid way to use FTP resources is loading it as
|
// The only valid way to use FTP resources is loading it as
|
||||||
// a top level document.
|
// a top level document.
|
||||||
|
if (!mozilla::net::nsIOService::BlockFTPSubresources()) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
|
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
|
||||||
if (!loadInfo) {
|
if (!loadInfo) {
|
||||||
|
|
|
@ -5435,6 +5435,9 @@ pref("layout.css.servo.enabled", true);
|
||||||
// URL-Bar will not be blocked when flipping this pref.
|
// URL-Bar will not be blocked when flipping this pref.
|
||||||
pref("security.data_uri.block_toplevel_data_uri_navigations", true);
|
pref("security.data_uri.block_toplevel_data_uri_navigations", true);
|
||||||
|
|
||||||
|
// If true, all FTP subresource loads will be blocked.
|
||||||
|
pref("security.block_ftp_subresources", true);
|
||||||
|
|
||||||
// Disable Storage api in release builds.
|
// Disable Storage api in release builds.
|
||||||
#ifdef NIGHTLY_BUILD
|
#ifdef NIGHTLY_BUILD
|
||||||
pref("dom.storageManager.enabled", true);
|
pref("dom.storageManager.enabled", true);
|
||||||
|
|
|
@ -164,6 +164,7 @@ uint32_t nsIOService::gDefaultSegmentSize = 4096;
|
||||||
uint32_t nsIOService::gDefaultSegmentCount = 24;
|
uint32_t nsIOService::gDefaultSegmentCount = 24;
|
||||||
|
|
||||||
bool nsIOService::sBlockToplevelDataUriNavigations = false;
|
bool nsIOService::sBlockToplevelDataUriNavigations = false;
|
||||||
|
bool nsIOService::sBlockFTPSubresources = false;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -238,6 +239,8 @@ nsIOService::Init()
|
||||||
|
|
||||||
Preferences::AddBoolVarCache(&sBlockToplevelDataUriNavigations,
|
Preferences::AddBoolVarCache(&sBlockToplevelDataUriNavigations,
|
||||||
"security.data_uri.block_toplevel_data_uri_navigations", false);
|
"security.data_uri.block_toplevel_data_uri_navigations", false);
|
||||||
|
Preferences::AddBoolVarCache(&sBlockFTPSubresources,
|
||||||
|
"security.block_ftp_subresources", true);
|
||||||
Preferences::AddBoolVarCache(&mOfflineMirrorsConnectivity, OFFLINE_MIRRORS_CONNECTIVITY, true);
|
Preferences::AddBoolVarCache(&mOfflineMirrorsConnectivity, OFFLINE_MIRRORS_CONNECTIVITY, true);
|
||||||
|
|
||||||
gIOService = this;
|
gIOService = this;
|
||||||
|
@ -1767,5 +1770,11 @@ nsIOService::BlockToplevelDataUriNavigations()
|
||||||
return sBlockToplevelDataUriNavigations;
|
return sBlockToplevelDataUriNavigations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*static*/ bool
|
||||||
|
nsIOService::BlockFTPSubresources()
|
||||||
|
{
|
||||||
|
return sBlockFTPSubresources;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace net
|
} // namespace net
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
@ -93,6 +93,8 @@ public:
|
||||||
|
|
||||||
static bool BlockToplevelDataUriNavigations();
|
static bool BlockToplevelDataUriNavigations();
|
||||||
|
|
||||||
|
static bool BlockFTPSubresources();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// These shouldn't be called directly:
|
// These shouldn't be called directly:
|
||||||
// - construct using GetInstance
|
// - construct using GetInstance
|
||||||
|
@ -168,6 +170,8 @@ private:
|
||||||
|
|
||||||
static bool sBlockToplevelDataUriNavigations;
|
static bool sBlockToplevelDataUriNavigations;
|
||||||
|
|
||||||
|
static bool sBlockFTPSubresources;
|
||||||
|
|
||||||
// Time a network tearing down started.
|
// Time a network tearing down started.
|
||||||
mozilla::Atomic<PRIntervalTime> mNetTearingDownStarted;
|
mozilla::Atomic<PRIntervalTime> mNetTearingDownStarted;
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user