Commit 40c315a
committed
Add new procedural cosmetic filter operator:
Related issue:
- uBlockOrigin/uBlock-issues#2185
The argument must be a valid media query as documented on MDN, i.e.
what appears between the `@media` at-rule and the first opening
curly bracket (including the parentheses when required):
- https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
Best practice:
Use `:matches-media()` after plain CSS selectors, if any.
Good:
example.com###target-1 > .target-2:matches-media((min-width: 800px))
Bad (though this will still work):
example.com##:matches-media((min-width: 800px)) #target-1 > .target-2
The reason for this is to keep the door open for a future optimisation
where uBO could convert `:matches-media()`-based filters into CSS media
rules injected declaratively in a user stylesheet.:matches-media()
1 parent deb5fea commit 40c315a
2 files changed
+42
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
111 | 119 | | |
112 | 120 | | |
113 | | - | |
114 | | - | |
115 | | - | |
| 121 | + | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
135 | 154 | | |
136 | 155 | | |
137 | 156 | | |
| |||
322 | 341 | | |
323 | 342 | | |
324 | 343 | | |
| 344 | + | |
325 | 345 | | |
326 | 346 | | |
327 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1581 | 1581 | | |
1582 | 1582 | | |
1583 | 1583 | | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
1584 | 1596 | | |
1585 | 1597 | | |
1586 | 1598 | | |
| |||
1702 | 1714 | | |
1703 | 1715 | | |
1704 | 1716 | | |
| 1717 | + | |
1705 | 1718 | | |
1706 | 1719 | | |
1707 | 1720 | | |
| |||
1878 | 1891 | | |
1879 | 1892 | | |
1880 | 1893 | | |
| 1894 | + | |
| 1895 | + | |
1881 | 1896 | | |
1882 | 1897 | | |
1883 | 1898 | | |
| |||
1918 | 1933 | | |
1919 | 1934 | | |
1920 | 1935 | | |
1921 | | - | |
| 1936 | + | |
| 1937 | + | |
1922 | 1938 | | |
1923 | 1939 | | |
1924 | 1940 | | |
| |||
0 commit comments