Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: pages/filters.html

Issue 29482703: Issue 5353 - Add advanced element hiding filters documentation (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org/
Patch Set: Changed the string ids to be readable Created July 10, 2017, 4:19 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pages/filter-cheatsheet.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 useful to filter subscription authors who are extending another filter subscri ption that they 240 useful to filter subscription authors who are extending another filter subscri ption that they
241 cannot change.}} {{s102 For example, the rule <code><fix>##div.textad</fix></c ode> can be 241 cannot change.}} {{s102 For example, the rule <code><fix>##div.textad</fix></c ode> can be
242 disabled on <code><fix>example.com</fix></code> using the exception rule 242 disabled on <code><fix>example.com</fix></code> using the exception rule
243 <code><fix>example.com#@#div.textad</fix></code>.}} {{s103 The combination of these two 243 <code><fix>example.com#@#div.textad</fix></code>.}} {{s103 The combination of these two
244 rules has exactly the same effect as the single rule 244 rules has exactly the same effect as the single rule
245 <code><fix>~example.com##div.textad</fix></code>.}} {{s104 It is recommended t hat you use 245 <code><fix>~example.com##div.textad</fix></code>.}} {{s104 It is recommended t hat you use
246 exception rules only when you cannot change an overly general element hiding r ule, in all the 246 exception rules only when you cannot change an overly general element hiding r ule, in all the
247 other cases limiting this rule to the necessary domains is preferable.}} 247 other cases limiting this rule to the necessary domains is preferable.}}
248 </p> 248 </p>
249 249
250 <h3 id="elemhide-emulation">{{elemhide-emulation-title Advanced element hiding}} </h3>
kzar 2017/07/11 12:56:17 It seems more logical to me to put this new sectio
hub 2017/07/11 22:25:58 make sense
251
252 <p>
253 {{elemhide-emulation-explanation-p1 Advanced hiding rules will hide elements t hat matches the CSS selector directly. <code><fix>example.com#?#div.textad</fix> </code> will directly hide <code><fix>&lt;div&gt;</fix></code> elements with the <code><fix>textad</fix></code> class. These filters only exist as <a href="#gen eric-specific">specific filters</a>: a domain is mandatory.}}
kzar 2017/07/11 12:56:17 I don't understand what you mean by "matches the C
254 </p>
255 <p>
256 {{elemhide-emulation-explanation-p2 <a href="#elemhide_exceptions">Exception r ules</a> above can be applied to the advanced hiding rules the same way.}}
kzar 2017/07/11 12:56:17 This sentence doesn't seem to add much.
hub 2017/07/11 22:25:58 I'll remove this.
257 </p>
258 <p>
259 {{elemhide-emulation-explanation-p3 Advanced hiding rules also introduce new p seudo-class selectors for when a plain CSS selector isn't enough. <code><fix>:-a bp-has(selector)</fix></code> will select the element whose content match the en closed selector. <code><fix>:-abp-properties(properties)</fix></code> will match elements based on their CSS style properties.}}
260 </p>
261 <p>
262 {{elemhide-emulation-explanation-p4 <code><fix>:-abp-properties(properties)</f ix></code> will select elements based on properties of their stylesheet. For exa mple, <code><fix>:-abp-properties(width:300px;height:250px;)</fix></code> will s elect elements that have <code><fix>width</fix></code> and <code><fix>height</fi x></code> set to the specified values <code><fix>300px</fix></code> and <code><f ix>250px</fix></code> respectively. The <a href="https://adblockplus.org/develop ment-builds/new-css-property-filter-syntax">older syntax</a> for the filters is deprecated and will be automatically converted to the new format&nbsp;; the synt ax to select the style properties remain the same.}}
kzar 2017/07/11 12:56:17 Nit: It looks wrong to me to put a comma after "Fo
hub 2017/07/11 22:25:58 Acknowledged.
263 </p>
264 <p>
265 {{elemhide-emulation-explanation-p5 <code><fix>:-abp-has(selector)</fix></code > will select elements based on their content. For example, <code><fix>:-abp-has (> div > a.advertiser)</fix></code> will select elements that contain as a direc t descendant a <code><fix>&lt;div&gt;</fix></code> that contains an <code><fix>& lt;a&gt;</fix></code> with the class <code><fix>advertiser</fix></code>. The inn er selector matching determine whether the selection occur. It is important that <code><fix>:-abp-has()</fix></code> be applied to a restricted number of elemen ts to avoid performance issues. Like any regular pseudo-class you can combine it with the CSS selector syntax.}}
kzar 2017/07/11 12:56:17 Perhaps the sentence about limiting the number of
hub 2017/07/11 22:25:58 Acknowledged.
266 </p>
267
250 <h3 id="elemhide_simplified">{{s105 Simplified element hiding syntax}}</h3> 268 <h3 id="elemhide_simplified">{{s105 Simplified element hiding syntax}}</h3>
251 269
252 <p>{{s106 Adblock Plus supports simplified element hiding syntax (e.g. <code>< fix>#div(id=foo)</fix></code>) for backwards compatibility only. Using this synt ax is discouraged, usual CSS selectors are preferred. Support for this syntax mi ght be removed at some point.}}</p> 270 <p>{{s106 Adblock Plus supports simplified element hiding syntax (e.g. <code>< fix>#div(id=foo)</fix></code>) for backwards compatibility only. Using this synt ax is discouraged, usual CSS selectors are preferred. Support for this syntax mi ght be removed at some point.}}</p>
253 271
254 <h3 id="generic-specific">{{generic-specific-title Generic / Specific filters} }</h3> 272 <h3 id="generic-specific">{{generic-specific-title Generic / Specific filters} }</h3>
255 273
256 <p>{{generic-specific-explanation-p1 With the <code><fix>$generichide</fix></c ode> and <code><fix>$genericblock</fix></code> filter options the distinction be tween generic and specific filters becomes important.}}</p> 274 <p>{{generic-specific-explanation-p1 With the <code><fix>$generichide</fix></c ode> and <code><fix>$genericblock</fix></code> filter options the distinction be tween generic and specific filters becomes important.}}</p>
257 <p>{{generic-specific-explanation-p2 We classify a filter to be <strong>specif ic</strong> if it matches one or more domains or matches a sitekey. If a filter has no domains specified (or only domain exceptions) and no sitekey then it coun ts as <strong>generic</strong>. For example, <code><fix>example.com##div.textad< /fix></code> is a specific filter, whereas both <code><fix>##div.textad</fix></c ode> and <code><fix>~example.com##div.textad</fix></code> are generic.}}</p> 275 <p>{{generic-specific-explanation-p2 We classify a filter to be <strong>specif ic</strong> if it matches one or more domains or matches a sitekey. If a filter has no domains specified (or only domain exceptions) and no sitekey then it coun ts as <strong>generic</strong>. For example, <code><fix>example.com##div.textad< /fix></code> is a specific filter, whereas both <code><fix>##div.textad</fix></c ode> and <code><fix>~example.com##div.textad</fix></code> are generic.}}</p>
258 <p>{{generic-specific-explanation-p3 Note that with blocking rules the domain must be specified under the $domain option for them to be considered specific. F or example, <code><fix>||example.com^</fix></code> is considered generic whereas <code><fix>*/ads/*$domain=example.com</fix></code> is site-specific.}}</p> 276 <p>{{generic-specific-explanation-p3 Note that with blocking rules the domain must be specified under the $domain option for them to be considered specific. F or example, <code><fix>||example.com^</fix></code> is considered generic whereas <code><fix>*/ads/*$domain=example.com</fix></code> is site-specific.}}</p>
259 277
(...skipping 11 matching lines...) Expand all
271 {{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:}} 289 {{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:}}
272 </p> 290 </p>
273 291
274 <pre> 292 <pre>
275 /index.html?q=foo\0www.example.com\0Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv :30.0) Gecko/20100101 Firefox/30.0 293 /index.html?q=foo\0www.example.com\0Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv :30.0) Gecko/20100101 Firefox/30.0
276 </pre> 294 </pre>
277 295
278 <p> 296 <p>
279 {{s111 Finally, generate the signature for this string by using the signature algorithm SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE (default when using OpenSSL).}} 297 {{s111 Finally, generate the signature for this string by using the signature algorithm SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE (default when using OpenSSL).}}
280 </p> 298 </p>
OLDNEW
« no previous file with comments | « pages/filter-cheatsheet.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld