Extension Blocklisting:Code Design: Difference between revisions
Jump to navigation
Jump to search
| Line 9: | Line 9: | ||
== Blacklist syntax == | == Blacklist syntax == | ||
* Blacklist file has | * Blacklist file has a flexible xml syntax: | ||
<entryType> <extension ID> [<minVersion> <maxVersion>] | <entryType> <extension ID> [<minVersion> <maxVersion>] | ||
| Line 22: | Line 22: | ||
<pre><blacklist xmlns="http://www.mozilla.org/2006/blacklist"> | <pre><blacklist xmlns="http://www.mozilla.org/2006/blacklist"> | ||
<emItems> | <emItems> | ||
<emItem id=" | <emItem id="item_1@domain"> | ||
<versionRange minVersion="1.0" maxVersion="2.0.*"> | <versionRange minVersion="1.0" maxVersion="2.0.*"> | ||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> | <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> | ||
| Line 41: | Line 41: | ||
</targetApplication> | </targetApplication> | ||
</emItem> | </emItem> | ||
<emItem id=" | <emItem id="item_2@domain"> | ||
<versionRange minVersion="3.1" maxVersion="4.*"/> | <versionRange minVersion="3.1" maxVersion="4.*"/> | ||
</emItem> | </emItem> | ||
<emItem id=" | <emItem id="item_3@domain"> | ||
<versionRange> | |||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"> | |||
<versionRange minVersion="1.5" maxVersion="1.5.*"/> | |||
</targetApplication> | |||
</versionRange> | |||
</emItem> | |||
<emItem id="item_4@domain"/> | |||
</emItems> | </emItems> | ||
</blacklist></pre> | </blacklist></pre> | ||
Revision as of 22:29, 14 February 2006
Simple blacklisting for Firefox 1.5
Update model
- Download a blacklist file on a timer (86400 default)
- If items are newly blacklisted or unblacklisted, adjust the datasource appropriately and prompt to restart.
- The blacklist file will be placed in the profile-dir.
- Blacklist is _replaced_ on each update, not merged or otherwise combined.
Blacklist syntax
- Blacklist file has a flexible xml syntax:
<entryType> <extension ID> [<minVersion> <maxVersion>]
entryType can be "forbid" to force an extension (with optional version range) to be disabled, or "permit" to exempt a given extension (usually with version) from blacklisting. If minVersion is specified, maxVersion must also be specified (though they can be equal). Versions are compared inclusively.
The blacklist file is processed in order, and the first rule found that matches a given extension determines if the extension is disabled (forbid rule found) or not (permit rule found). If no matching rule is found, the extension is permitted (not disabled by the blacklist).
Blank lines are skipped, and # introduces a comment running until the end of the line.
Examples:
<blacklist xmlns="http://www.mozilla.org/2006/blacklist">
<emItems>
<emItem id="item_1@domain">
<versionRange minVersion="1.0" maxVersion="2.0.*">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="1.5" maxVersion="1.5.*"/>
<versionRange minVersion="1.7" maxVersion="1.7.*"/>
</targetApplication>
<targetApplication id="toolkit@mozilla.org">
<versionRange minVersion="1.8" maxVersion="1.8.*"/>
</targetApplication>
</versionRange>
<versionRange minVersion="3.0" maxVersion="3.0.*">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="1.5" maxVersion="1.5.*"/>
</targetApplication>
</versionRange>
<targetApplication id="toolkit@mozilla.org">
<versionRange minVersion="1.8" maxVersion="1.8.*"/>
</targetApplication>
</emItem>
<emItem id="item_2@domain">
<versionRange minVersion="3.1" maxVersion="4.*"/>
</emItem>
<emItem id="item_3@domain">
<versionRange>
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="1.5" maxVersion="1.5.*"/>
</targetApplication>
</versionRange>
</emItem>
<emItem id="item_4@domain"/>
</emItems>
</blacklist>