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

Delta Between Two Patch Sets: pages/filter-cheatsheet.html

Issue 29482703: Issue 5353 - Add advanced element hiding filters documentation (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org/
Left Patch Set: Created July 7, 2017, 5:38 p.m.
Right Patch Set: Added [header] Created July 28, 2017, 8:03 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | pages/filters.html » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 title=Adblock Plus filters explained 1 title=Adblock Plus filters explained
2 2
3 <head> 3 <head>
4 <style type="text/css"> 4 <style type="text/css">
5 #content 5 #content
6 { 6 {
7 max-width: none; 7 max-width: none;
8 } 8 }
9 9
10 canvas 10 canvas
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 <td><code>##div[style$=&quot;width:300px;height:250px;&quot;]</code></td> 790 <td><code>##div[style$=&quot;width:300px;height:250px;&quot;]</code></td>
791 <td>{{s137 Matches div elements that end the style specified}}</td> 791 <td>{{s137 Matches div elements that end the style specified}}</td>
792 </tr> 792 </tr>
793 <tr> 793 <tr>
794 <td><code>##div[style*=&quot;width:300px;height:250px;&quot;]</code></td> 794 <td><code>##div[style*=&quot;width:300px;height:250px;&quot;]</code></td>
795 <td>{{s138 Matches div elements that containing the style specified}}</td> 795 <td>{{s138 Matches div elements that containing the style specified}}</td>
796 </tr> 796 </tr>
797 </table> 797 </table>
798 <p>{{s139 The above filters are only examples of valid element hiding rules. Any <a href="http://www.w3.org/TR/css3-selectors/">CSS selector</a> supported by Fi refox can be used for element hiding.}}</p> 798 <p>{{s139 The above filters are only examples of valid element hiding rules. Any <a href="http://www.w3.org/TR/css3-selectors/">CSS selector</a> supported by Fi refox can be used for element hiding.}}</p>
799 799
800 <h2 id="elementhideemulation">{{s140 Advanced element hiding}}</h2> 800 <h3 id="elementhideemulation">{{ abp-pseudo-select-heading[heading] Extended CSS selectors (Adblock Plus specific) }}</h3>
801 801
802 <p>{{s141 <code><fix>#?#</fix></code> indicate an advanced element hiding rule. Unlike the element hiding rules, these require to be specific and therefor to ha ve <a href="#elementdomains">domain selection</a> not be empty. When used with a valid CSS selector, it will hide the elements directly. All the examples of <a href="#elementselection">element selection</a> above apply (replace <code><fix># #</fix></code> with <code><fix>#?#</fix></code>). These filters also support adv anced element selection that are Adblock Plus extensions to CSS.}}</p> 802 <p>{{ abp-pseudo-select-1 In some situations standard CSS selectors are not suff icient, for those cases you can also use the following Adblock Plus specific pse udo-selectors: }}</p>
803
804 <p>{{s142 This is a new feature in Adblock Plus 1.13.3 for Chrome and Opera}}.</ p>
805
806 <h3>{{s143 Advanced element selection}}</h3>
807
808 <p>{{s148 Here are the pseudo-classes implemented for the advanced element selec tion}}</p>
809 803
810 <table> 804 <table>
811 <col class="selector"> 805 <col class="selector">
812 <col class="selectorPurpose"> 806 <col class="selectorPurpose">
813 <tr> 807 <tr>
814 <th>{{s149 Pseudo-class}}</th> 808 <th>{{ pseudo-class-header[header] Pseudo-class }}</th>
815 <th>{{s127 Purpose}}</th> 809 <th>{{ s127 Purpose }}</th>
816 </tr> 810 </tr>
817 <tr> 811 <tr>
818 <td><code>:-abp-properties()</code></td> 812 <td><code>:-abp-properties()</code></td>
819 <td>{{s150 Select an element if its CSS style properties match the one speci fied}}</td> 813 <td>{{ abp-properties-purpose Select an element if its CSS style properties match what's specified }}</td>
820 </tr> 814 </tr>
821 <tr> 815 <tr>
822 <td><code>:-abp-has()</code></td> 816 <td><code>:-abp-has()</code></td>
823 <td>{{s151 Select an element if its content subtree match the selector speci fied}}</td> 817 <td>{{ abp-has-purpose Select an element if its content subtree match the se lector specified }}</td>
824 </tr> 818 </tr>
825 </table> 819 </table>
826 820
827 <p>{{s144 These few examples show how to use the pseudo-class form of the advanc ed element selection}}</p> 821 <p>{{ abp-pseudo-select-2 When writing element hiding filters that make use thos e you must use the <code>#?#</code> syntax (replace <code>##</code> with <code># ?#</code>) and take care to specify one or more domains. Some examples: }}</p>
828 822
829 <table> 823 <table>
830 <col class="selector"> 824 <col class="selector">
831 <col class="selectorPurpose"> 825 <col class="selectorPurpose">
832 <tr> 826 <tr>
833 <th>{{s126 Selector}}</th> 827 <th>{{ s126 Selector }}</th>
834 <th>{{s127 Purpose}}</th> 828 <th>{{ s127 Purpose }}</th>
835 </tr> 829 </tr>
836 <tr> 830 <tr>
837 <td><code>#?#div:-abp-properties(width:300px;height:250px;)</code></td> 831 <td><code>example.com#?#div:-abp-properties(width:300px;height:250px;)</code ></td>
838 <td>{{s145 Matches <code><fix>div</fix></code> elements whose style contain the specified properties}}</td> 832 <td>{{ abp-properties-example Matches <code><fix>div</fix></code> elements w hose style contain the specified properties }}</td>
839 </tr> 833 </tr>
840 <tr> 834 <tr>
841 <td><code>#?#div:-abp-has(> div > img.advert)</code></td> 835 <td><code>example.com#?#div:-abp-has(&gt; div &gt; img.advert)</code></td>
842 <td>{{s146 Matches <code><fix>div</fix></code> elements that contain as a di rect descendant a <code><fix>div</fix></code> containing an <code><fix>img</fix> </code> with the class "advert"}}</td> 836 <td>{{ abp-has-example1 Matches <code><fix>div</fix></code> elements that co ntain as a direct descendant a <code><fix>div</fix></code> element whose direct descendant is an <code><fix>img</fix></code> with the class "advert" }}</td>
843 </tr> 837 </tr>
844 <tr> 838 <tr>
845 <td><code>#?#div:-abp-has(> div > img:-abp-properties(width:300px;height:250 px;))</code></td> 839 <td><code>example.com#?#div:-abp-has(&gt; div &gt; img:-abp-properties(width :300px;height:250px;))</code></td>
846 <td>{{s147 Matches <code><fix>div</fix></code> elements that contain as a di rect descendant element matching the selector: a <code><fix>div</fix></code> tha t has a child <code><fix>img</fix></code> whose style properties contain the spe cified properties}}</td> 840 <td>{{ abp-has-example2 Matches <code><fix>div</fix></code> elements that co ntain as a direct descendant a <code><fix>div</fix></code> element whose direct descendant is an <code><fix>img</fix></code> element whose style properties cont ain the specified properties, a <code><fix>width</fix></code> of 300 pixels and an <code><fix>height</fix></code> of 250 pixels }}</td>
841 </tr>
842 <tr>
843 <td><code>example.com#?#div:-abp-has(&gt; div &gt; img:-abp-properties(WidTh :300px;hEigHt:250px;))</code></td>
844 <td>{{ abp-has-example3 Since the CSS properties are matched case-insensitiv ely, this filter matches the same thing as above }}</td>
845 </tr>
846 <tr>
847 <td><code>example.com#?#div &gt; img:-abp-properties(width:*px;height:250px; )</code></td>
848 <td>{{ abp-properties-example1 By using a wildcard <code>*</code>, this filt er matches an <code>img</code> whose CSS style properties have a <code>width</co de> specified in pixels and a <code>height</code> of 250 pixels }}</td>
849 </tr>
850 <tr>
851 <td><code>example.com#?#div &gt; img:-abp-properties(/width: 3[2-8]px;/)</co de></td>
852 <td>{{ abp-properties-example2 By using a regular expression, this filter ma tches an <code>img</code> whose CSS style properties have a <code>width</code> b etween 32 and 38 pixels }}</td>
847 </tr> 853 </tr>
848 </table> 854 </table>
849 855
LEFTRIGHT
« no previous file | pages/filters.html » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld