Bug 850721 - fix social blocklist oranges by not enabling the default update server. r=mixedpuppy

This commit is contained in:
Mark Hammond
2014-02-07 12:07:04 +11:00
parent 25b263f6b9
commit 2d9ea4a6eb

View File

@@ -313,14 +313,24 @@ function updateBlocklist(aCallback) {
blocklistNotifier.notify(null);
}
var _originalTestBlocklistURL = null;
function setAndUpdateBlocklist(aURL, aCallback) {
if (!_originalTestBlocklistURL)
_originalTestBlocklistURL = Services.prefs.getCharPref("extensions.blocklist.url");
Services.prefs.setCharPref("extensions.blocklist.url", aURL);
updateBlocklist(aCallback);
}
function resetBlocklist(aCallback) {
Services.prefs.clearUserPref("extensions.blocklist.url");
updateBlocklist(aCallback);
// XXX - this has "forked" from the head.js helpers in our parent directory :(
// But let's reuse their blockNoPlugins.xml. Later, we should arrange to
// use their head.js helpers directly
let noBlockedURL = "http://example.com/browser/browser/base/content/test/general/blockNoPlugins.xml";
setAndUpdateBlocklist(noBlockedURL, function() {
Services.prefs.setCharPref("extensions.blocklist.url", _originalTestBlocklistURL);
if (aCallback)
aCallback();
});
}
function setManifestPref(name, manifest) {