diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index 2f665df8e166..e1c6d4b05128 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -363,6 +363,9 @@ libs:: libs:: $(srcdir)/profile/prefs.js $(INSTALL) $^ $(DIST)/bin/defaults/profile +libs:: $(srcdir)/blocklist.xml + $(INSTALL) $^ $(DIST)/bin + ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) APP_NAME = $(MOZ_APP_DISPLAYNAME) diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml new file mode 100644 index 000000000000..bd22b625bf03 --- /dev/null +++ b/browser/app/blocklist.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/browser/installer/unix/packages-static b/browser/installer/unix/packages-static index d420205d6778..ab2e3a719ca8 100644 --- a/browser/installer/unix/packages-static +++ b/browser/installer/unix/packages-static @@ -51,6 +51,7 @@ bin/run-mozilla.sh bin/plugins/libnullplugin.so bin/libsqlite3.so bin/README.txt +bin/blocklist.xml ; [Components] bin/components/alerts.xpt diff --git a/browser/installer/windows/packages-static b/browser/installer/windows/packages-static index ba394058eb52..c7973956ee24 100644 --- a/browser/installer/windows/packages-static +++ b/browser/installer/windows/packages-static @@ -60,6 +60,7 @@ bin\plugins\npnul32.dll bin\LICENSE bin\README.txt bin\sqlite3.dll +bin\blocklist.xml ; [Components] bin\components\alerts.xpt diff --git a/toolkit/mozapps/extensions/src/nsBlocklistService.js b/toolkit/mozapps/extensions/src/nsBlocklistService.js index cd7056ec7c32..ae85bfacad53 100644 --- a/toolkit/mozapps/extensions/src/nsBlocklistService.js +++ b/toolkit/mozapps/extensions/src/nsBlocklistService.js @@ -47,6 +47,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); const TOOLKIT_ID = "toolkit@mozilla.org" const KEY_PROFILEDIR = "ProfD"; +const KEY_APPDIR = "XCurProcD"; const FILE_BLOCKLIST = "blocklist.xml"; const PREF_BLOCKLIST_URL = "extensions.blocklist.url"; const PREF_BLOCKLIST_ENABLED = "extensions.blocklist.enabled"; @@ -275,7 +276,7 @@ Blocklist.prototype = { isAddonBlocklisted: function(id, version, appVersion, toolkitVersion) { if (!this._addonEntries) - this._loadBlocklistFromFile(getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST])); + this._loadBlocklist(); if (!appVersion) appVersion = gApp.version; if (!toolkitVersion) @@ -398,6 +399,21 @@ Blocklist.prototype = { statusText); }, + /** + * Finds the newest blocklist file from the application and the profile and + * load it or does nothing if neither exist. + */ + _loadBlocklist: function() { + var profFile = getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST]); + if (profFile.exists()) { + this._loadBlocklistFromFile(profFile); + return; + } + var appFile = getFile(KEY_APPDIR, [FILE_BLOCKLIST]); + if (appFile.exists()) + this._loadBlocklistFromFile(appFile); + }, + /** # The blocklist XML file looks something like this: # @@ -581,7 +597,7 @@ Blocklist.prototype = { _checkPluginsList: function() { if (!this._addonEntries) - this._loadBlocklistFromFile(getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST])); + this._loadBlocklist(); var phs = Cc["@mozilla.org/plugin/host;1"]. getService(Ci.nsIPluginHost); phs.getPluginTags({ }).forEach(this._checkPlugin, this);