| OLD | NEW |
| 1 title=Writing Adblock Plus filters | 1 title=Writing Adblock Plus filters |
| 2 | 2 |
| 3 | 3 |
| 4 <p>{{s1 Current Adblock Plus versions allow you to "tweak" your filters in many
different ways. This document explains the choices that you have and how they ca
n be used.}}</p> | 4 <p>{{s1 Current Adblock Plus versions allow you to "tweak" your filters in many
different ways. This document explains the choices that you have and how they ca
n be used.}}</p> |
| 5 | 5 |
| 6 <p>{{s2 <em>Disclaimer</em>: All filter examples given here are really only ex
amples and are not meant to be used.}}</p> | 6 <p>{{s2 <em>Disclaimer</em>: All filter examples given here are really only ex
amples and are not meant to be used.}}</p> |
| 7 | 7 |
| 8 <h2 id="introduction">{{s3 Introduction to Adblock Plus filters}}</h2> | 8 <h2 id="introduction">{{s3 Introduction to Adblock Plus filters}}</h2> |
| 9 | 9 |
| 10 <p>{{s4 The options described in this section should be enough for users who h
ave to create a filter occasionally.}}</p> | 10 <p>{{s4 The options described in this section should be enough for users who h
ave to create a filter occasionally.}}</p> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 </p> | 72 </p> |
| 73 <p> | 73 <p> |
| 74 {{s28 This comment sets the update interval for the filter list, the value
can be given in days (e.g. <code><fix>5 days</fix></code>) or hours | 74 {{s28 This comment sets the update interval for the filter list, the value
can be given in days (e.g. <code><fix>5 days</fix></code>) or hours |
| 75 (e.g. <code><fix>8 hours</fix></code>).}} {{s29 Any value between 1 hour a
nd 14 days is possible.}} {{s30 Note that the update | 75 (e.g. <code><fix>8 hours</fix></code>).}} {{s29 Any value between 1 hour a
nd 14 days is possible.}} {{s30 Note that the update |
| 76 will not necessarily happen after this time interval.}} {{s31 The actual u
pdate time is slightly randomized and depends on | 76 will not necessarily happen after this time interval.}} {{s31 The actual u
pdate time is slightly randomized and depends on |
| 77 some additional factors to reduce server load.}} | 77 some additional factors to reduce server load.}} |
| 78 </p> | 78 </p> |
| 79 </li> | 79 </li> |
| 80 <li> | 80 <li> |
| 81 <p> | 81 <p> |
| 82 <code>! Checksum: OaopkIiiAl77sSHk/VAWDA</code> | |
| 83 </p> | |
| 84 <p> | |
| 85 {{s32 This comment makes sure that accidental corruption of the data won't
result | |
| 86 in broken filters.}} {{s33 For example, some firewall software might modif
y the filter <code>*/adnetwork/*</code> on download | |
| 87 in an attempt to protect the user against ads.}} {{s34 It will remove part
of the filter so that Adblock Plus will only see | |
| 88 the filter}} <code>**</code>{{s35 .}} {{s36 A checksum comment in the filt
er list protects against this scenario, any modifications | |
| 89 will have the result that the checksum no longer matches and Adblock Plus
will ignore the data.}} | |
| 90 </p> | |
| 91 <p> | |
| 92 {{s37 To calculate the checksum the following steps need to be performed:}
} | |
| 93 </p> | |
| 94 <ul> | |
| 95 <li>{{s38 Remove the existing checksum comment if any.}}</li> | |
| 96 <li>{{s39 Encode filter list text using UTF-8 encoding.}}</li> | |
| 97 <li>{{s40 Convert all line breaks to Unix style (replace <code><fix>\r</fi
x></code> by <code><fix>\n</fix></code> if present).}}</li> | |
| 98 <li>{{s41 Remove empty lines (replace sequences of the <code><fix>\n</fix>
</code> character by a single <code><fix>\n</fix></code> character).}}</li> | |
| 99 <li>{{s42 Calculate the base64-encoded MD5 checksum of the text, remove tr
ailing}} <code>=</code> {{s43 characters if any.}}</li> | |
| 100 </ul> | |
| 101 <p> | |
| 102 {{s44 You can also have a look at the Python-based reference implementatio
ns to | |
| 103 <a href="https://hg.adblockplus.org/adblockplus/file/tip/validateChecksum.
py">validate a checksum</a> and to | |
| 104 <a href="https://hg.adblockplus.org/adblockplus/file/tip/addChecksum.py">a
dd a checksum to a file</a>.}} | |
| 105 </p> | |
| 106 </li> | |
| 107 <li> | |
| 108 <p> | |
| 109 <code>! Redirect: http://example.com/list.txt</code> | 82 <code>! Redirect: http://example.com/list.txt</code> |
| 110 </p> | 83 </p> |
| 111 <p> | 84 <p> |
| 112 {{s45 This comment indicates that the filter list has moved to a new downl
oad address.}} {{s46 Adblock Plus will ignore any file | 85 {{s45 This comment indicates that the filter list has moved to a new downl
oad address.}} {{s46 Adblock Plus will ignore any file |
| 113 contents beyond that comment and immediately try downloading from the new
address.}} {{s47 In case of success the address | 86 contents beyond that comment and immediately try downloading from the new
address.}} {{s47 In case of success the address |
| 114 of the filter list will be updated in the settings.}} {{s48 This comment i
s ignored if the new address is the same as the | 87 of the filter list will be updated in the settings.}} {{s48 This comment i
s ignored if the new address is the same as the |
| 115 current address, meaning that it can be used to enforce the "canonical" ad
dress of the filter list.}} | 88 current address, meaning that it can be used to enforce the "canonical" ad
dress of the filter list.}} |
| 116 </p> | 89 </p> |
| 117 </li> | 90 </li> |
| 118 <li> | 91 <li> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 {{s110 The data used for creating the signature is a concatenated list of requ
est variables (namely URI, host and user agent) separated by the <code><fix>NUL<
/fix></code> character "\0". For example:}} | 278 {{s110 The data used for creating the signature is a concatenated list of requ
est variables (namely URI, host and user agent) separated by the <code><fix>NUL<
/fix></code> character "\0". For example:}} |
| 306 </p> | 279 </p> |
| 307 | 280 |
| 308 <pre> | 281 <pre> |
| 309 /index.html?q=foo\0www.example.com\0Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv
:30.0) Gecko/20100101 Firefox/30.0 | 282 /index.html?q=foo\0www.example.com\0Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv
:30.0) Gecko/20100101 Firefox/30.0 |
| 310 </pre> | 283 </pre> |
| 311 | 284 |
| 312 <p> | 285 <p> |
| 313 {{s111 Finally, generate the signature for this string by using the signature
algorithm SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE (default when using OpenSSL).}} | 286 {{s111 Finally, generate the signature for this string by using the signature
algorithm SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE (default when using OpenSSL).}} |
| 314 </p> | 287 </p> |
| OLD | NEW |