import change from mozilla upstream: Bug 1384330 - Blocking the mozAddonManager when pref 'privacy.resistFingerprinting.block_mozAddonManager' is true. r=arthuredelstein,mossop

This commit is contained in:
Roy Tam 2019-06-08 20:30:03 +08:00
commit f05d85ff6b

View file

@ -20,6 +20,12 @@ using namespace mozilla::dom;
static bool
IsValidHost(const nsACString& host) {
// This hidden pref allows users to disable mozAddonManager entirely if they want
// for fingerprinting resistance. Someone like Tor browser will use this pref.
if (Preferences::GetBool("privacy.resistFingerprinting.block_mozAddonManager")) {
return false;
}
// This is ugly, but Preferences.h doesn't have support
// for default prefs or locked prefs
nsCOMPtr<nsIPrefService> prefService (do_GetService(NS_PREFSERVICE_CONTRACTID));