forked from mirrors/gecko-dev
Bug 420356: Ship blocklist.xml with Firefox. r=gavin.sharp
This commit is contained in:
parent
ee3e251e7f
commit
77c7d93420
5 changed files with 42 additions and 2 deletions
|
|
@ -363,6 +363,9 @@ libs::
|
||||||
libs:: $(srcdir)/profile/prefs.js
|
libs:: $(srcdir)/profile/prefs.js
|
||||||
$(INSTALL) $^ $(DIST)/bin/defaults/profile
|
$(INSTALL) $^ $(DIST)/bin/defaults/profile
|
||||||
|
|
||||||
|
libs:: $(srcdir)/blocklist.xml
|
||||||
|
$(INSTALL) $^ $(DIST)/bin
|
||||||
|
|
||||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||||
|
|
||||||
APP_NAME = $(MOZ_APP_DISPLAYNAME)
|
APP_NAME = $(MOZ_APP_DISPLAYNAME)
|
||||||
|
|
|
||||||
19
browser/app/blocklist.xml
Normal file
19
browser/app/blocklist.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
|
||||||
|
<emItems>
|
||||||
|
<emItem id="fdm_ffext@freedownloadmanager.org">
|
||||||
|
<versionRange minVersion="1.0" maxVersion="1.3.1">
|
||||||
|
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||||
|
<versionRange minVersion="3.0a1" maxVersion="*"/>
|
||||||
|
</targetApplication>
|
||||||
|
</versionRange>
|
||||||
|
</emItem>
|
||||||
|
<emItem id="mozilla_cc@internetdownloadmanager.com">
|
||||||
|
<versionRange minVersion="2.1" maxVersion="3.3">
|
||||||
|
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||||
|
<versionRange minVersion="3.0a1" maxVersion="*"/>
|
||||||
|
</targetApplication>
|
||||||
|
</versionRange>
|
||||||
|
</emItem>
|
||||||
|
</emItems>
|
||||||
|
</blocklist>
|
||||||
|
|
@ -51,6 +51,7 @@ bin/run-mozilla.sh
|
||||||
bin/plugins/libnullplugin.so
|
bin/plugins/libnullplugin.so
|
||||||
bin/libsqlite3.so
|
bin/libsqlite3.so
|
||||||
bin/README.txt
|
bin/README.txt
|
||||||
|
bin/blocklist.xml
|
||||||
|
|
||||||
; [Components]
|
; [Components]
|
||||||
bin/components/alerts.xpt
|
bin/components/alerts.xpt
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ bin\plugins\npnul32.dll
|
||||||
bin\LICENSE
|
bin\LICENSE
|
||||||
bin\README.txt
|
bin\README.txt
|
||||||
bin\sqlite3.dll
|
bin\sqlite3.dll
|
||||||
|
bin\blocklist.xml
|
||||||
|
|
||||||
; [Components]
|
; [Components]
|
||||||
bin\components\alerts.xpt
|
bin\components\alerts.xpt
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
|
||||||
const TOOLKIT_ID = "toolkit@mozilla.org"
|
const TOOLKIT_ID = "toolkit@mozilla.org"
|
||||||
const KEY_PROFILEDIR = "ProfD";
|
const KEY_PROFILEDIR = "ProfD";
|
||||||
|
const KEY_APPDIR = "XCurProcD";
|
||||||
const FILE_BLOCKLIST = "blocklist.xml";
|
const FILE_BLOCKLIST = "blocklist.xml";
|
||||||
const PREF_BLOCKLIST_URL = "extensions.blocklist.url";
|
const PREF_BLOCKLIST_URL = "extensions.blocklist.url";
|
||||||
const PREF_BLOCKLIST_ENABLED = "extensions.blocklist.enabled";
|
const PREF_BLOCKLIST_ENABLED = "extensions.blocklist.enabled";
|
||||||
|
|
@ -275,7 +276,7 @@ Blocklist.prototype = {
|
||||||
|
|
||||||
isAddonBlocklisted: function(id, version, appVersion, toolkitVersion) {
|
isAddonBlocklisted: function(id, version, appVersion, toolkitVersion) {
|
||||||
if (!this._addonEntries)
|
if (!this._addonEntries)
|
||||||
this._loadBlocklistFromFile(getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST]));
|
this._loadBlocklist();
|
||||||
if (!appVersion)
|
if (!appVersion)
|
||||||
appVersion = gApp.version;
|
appVersion = gApp.version;
|
||||||
if (!toolkitVersion)
|
if (!toolkitVersion)
|
||||||
|
|
@ -398,6 +399,21 @@ Blocklist.prototype = {
|
||||||
statusText);
|
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:
|
# The blocklist XML file looks something like this:
|
||||||
#
|
#
|
||||||
|
|
@ -581,7 +597,7 @@ Blocklist.prototype = {
|
||||||
|
|
||||||
_checkPluginsList: function() {
|
_checkPluginsList: function() {
|
||||||
if (!this._addonEntries)
|
if (!this._addonEntries)
|
||||||
this._loadBlocklistFromFile(getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST]));
|
this._loadBlocklist();
|
||||||
var phs = Cc["@mozilla.org/plugin/host;1"].
|
var phs = Cc["@mozilla.org/plugin/host;1"].
|
||||||
getService(Ci.nsIPluginHost);
|
getService(Ci.nsIPluginHost);
|
||||||
phs.getPluginTags({ }).forEach(this._checkPlugin, this);
|
phs.getPluginTags({ }).forEach(this._checkPlugin, this);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue