Bug 1431192 - Only fetch download protection lists when Safe Browsing is enabled. r?gcp
Download protection requires both the malware list as well as its
own special lists. The code therefore checks that both Safe
Browsing and download protection are enabled before checking
downloaded files.
The list manager should check the same prefs before downloading
any of the download protection lists in order to avoid connecting
to the Safe Browsing server when Safe Browsing is fully disabled.
MozReview-Commit-ID: 66vMA56T4pJ
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -400,24 +400,24 @@ this.SafeBrowsing = {
for (let i = 0; i < this.malwareLists.length; ++i) {
if (this.malwareEnabled) {
listManager.enableUpdate(this.malwareLists[i]);
} else {
listManager.disableUpdate(this.malwareLists[i]);
}
}
for (let i = 0; i < this.downloadBlockLists.length; ++i) {
- if (this.downloadsEnabled) {
+ if (this.malwareEnabled && this.downloadsEnabled) {
listManager.enableUpdate(this.downloadBlockLists[i]);
} else {
listManager.disableUpdate(this.downloadBlockLists[i]);
}
}
for (let i = 0; i < this.downloadAllowLists.length; ++i) {
- if (this.downloadsEnabled) {
+ if (this.malwareEnabled && this.downloadsEnabled) {
listManager.enableUpdate(this.downloadAllowLists[i]);
} else {
listManager.disableUpdate(this.downloadAllowLists[i]);
}
}
for (let i = 0; i < this.passwordAllowLists.length; ++i) {
if (this.passwordsEnabled) {
listManager.enableUpdate(this.passwordAllowLists[i]);