Bug 354199 ��� firefox fetches a key from sb.google.com in local list mode

patch: only get key when in remote mode
r=mmchew
This commit is contained in:
tony%ponderer.org 2006-12-28 06:54:35 +00:00
Родитель 8f46f173d1
Коммит 2a4cae1b8b
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -80,6 +80,10 @@ function PROT_DataProvider() {
// Watch for when anti-phishing is toggled on or off.
this.prefs_.addObserver(kPhishWardenEnabledPref,
BindToObject(this.loadDataProviderPrefs_, this));
// Watch for when remote lookups are toggled on or off.
this.prefs_.addObserver(kPhishWardenRemoteLookups,
BindToObject(this.loadDataProviderPrefs_, this));
}
/**
@ -129,11 +133,15 @@ PROT_DataProvider.prototype.updateListManager_ = function() {
listManager.setUpdateUrl(this.getUpdateURL());
// setKeyUrl has the side effect of fetching a key from the server.
// This shouldn't happen if anti-phishing is disabled, so we need to
// check for that.
// This shouldn't happen if anti-phishing is disabled or we're in local
// list mode, so we need to check for that.
var isEnabled = this.prefs_.getPref(kPhishWardenEnabledPref, false);
if (isEnabled) {
var remoteLookups = this.prefs_.getPref(kPhishWardenRemoteLookups, false);
if (isEnabled && remoteLookups) {
listManager.setKeyUrl(this.getKeyURL());
} else {
// Clear the key to stop updates.
listManager.setKeyUrl("");
}
}