Commit bde3164
committed
Add support for
New filter options
==================
Strict partyness: `1P`, `3P`
----------------------------
The current options 1p/3p are meant to "weakly" match partyness, i.e. a
network request is considered 1st-party to its context as long as both the
context and the request share the same base domain.
The new partyness options are meant to check for strict partyness, i.e. a
network request will be considered 1st-party if and only if both the context
and the request share the same hostname.
For examples:
- context: `www.example.org`
- request: `www.example.org`
- `1p`: yes, `1P`: yes
- `3p`: no, `3P`: no
- context: `www.example.org`
- request: `subdomain.example.org`
- `1p`: yes, `1P`: no
- `3p`: no, `3P`: yes
- context: `www.example.org`
- request: `www.example.com`
- `1p`: no, `1P`: no
- `3p`: yes, `3P`: yes
The strict partyness options will be visually emphasized in the editor so as
to prevent mistakenly using `1P` or `3P` where weak partyness is meant to be
used.
Filter on response headers: `header=`
-------------------------------------
Currently experimental and under evaluation. Disabled by default, enable by
toggling `filterOnHeaders` to `true` in advanced settings.
Ability to filter network requests according to whether a specific response
header is present and whether it matches or does not match a specific value.
For example:
*$1p,3P,script,header=via:1\.1\s+google
The above filter is meant to block network requests which fullfill all the
following conditions:
- is weakly 1st-party to the context
- is not strictly 1st-party to the context
- is of type `script`
- has a response HTTP header named `via`, which value matches the regular
expression `1\.1\s+google`.
The matches are always performed in a case-insensitive manner.
The header value is assumed to be a literal regular expression, except for
the following special characters:
- to anchor to start of string, use leading `|`, not `^`
- to anchor to end of string, use trailing `|`, not `$`
- to invert the test, use a leading `!`
To block a network request if it merely contains a specific HTTP header is
just a matter of specifying the header name without a header value:
*$1p,3P,script,header=via
Generic exception filters can be used to disable specific block `header=`
filters, i.e. `@@*$1p,3P,script,header` will override the block `header=`
filters given as example above.
Dynamic filtering's `allow` rules override block `headers=` filters.
Important: It is key that filter authors use as many narrowing filter options
as possible when using the `header=` option, and the `header=` option should
be used ONLY when other filter options are not sufficient.
More documentation justifying the purpose of `header=` option will be
provided eventually if ever it is decided to move it from experimental to
stable status.
To be decided: to restrict usage of this filter option to only uBO's own
filter lists or "My filters".
Changes
=======
Fine tuning `queryprune=`
-------------------------
The following changes have been implemented:
The special value `*` (i.e. `queryprune=*`) means "remove all query
parameters".
If the `queryprune=` value is made only of alphanumeric characters
(including `_`), the value will be internally converted to regex equivalent
`^value=`. This ensures a better future compatibility with AdGuard's
`removeparam=`.
If the `queryprune=` value starts with `!`, the test will be inverted. This
can be used to remove all query parameters EXCEPT those who match the
specified value.
Other
-----
The legacy code to test for spurious CSP reports has been removed. This
is no longer an issue ever since uBO redirects to local resources through
web accessible resources.
Notes
=====
The following new and recently added filter options are not compatible with
Chromium's manifest v3 changes:
- `queryprune=`
- `1P`
- `3P`
- `header=`1P, 3P, header= filter options and other changes1 parent 50ad64d commit bde3164
File tree
8 files changed
+409
-208
lines changed- src
- css
- themes
- js
- codemirror
8 files changed
+409
-208
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | | - | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | 215 | | |
217 | | - | |
218 | 216 | | |
219 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
220 | 222 | | |
221 | | - | |
222 | | - | |
223 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
224 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
225 | 234 | | |
226 | | - | |
227 | | - | |
228 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
229 | 251 | | |
230 | 252 | | |
231 | 253 | | |
| |||
259 | 281 | | |
260 | 282 | | |
261 | 283 | | |
262 | | - | |
| 284 | + | |
263 | 285 | | |
264 | 286 | | |
265 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
| |||
668 | 667 | | |
669 | 668 | | |
670 | 669 | | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
671 | 717 | | |
672 | 718 | | |
673 | 719 | | |
674 | 720 | | |
675 | | - | |
676 | 721 | | |
677 | 722 | | |
678 | 723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
| |||
369 | 370 | | |
370 | 371 | | |
371 | 372 | | |
372 | | - | |
| 373 | + | |
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
| |||
1900 | 1901 | | |
1901 | 1902 | | |
1902 | 1903 | | |
1903 | | - | |
1904 | | - | |
1905 | | - | |
1906 | | - | |
1907 | | - | |
1908 | | - | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
1938 | 1942 | | |
1939 | 1943 | | |
1940 | 1944 | | |
| |||
1974 | 1978 | | |
1975 | 1979 | | |
1976 | 1980 | | |
| 1981 | + | |
1977 | 1982 | | |
1978 | 1983 | | |
1979 | 1984 | | |
| 1985 | + | |
1980 | 1986 | | |
1981 | 1987 | | |
1982 | 1988 | | |
| |||
1993 | 1999 | | |
1994 | 2000 | | |
1995 | 2001 | | |
1996 | | - | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
1997 | 2006 | | |
1998 | 2007 | | |
1999 | 2008 | | |
| |||
2003 | 2012 | | |
2004 | 2013 | | |
2005 | 2014 | | |
2006 | | - | |
2007 | 2015 | | |
2008 | 2016 | | |
2009 | 2017 | | |
| 2018 | + | |
2010 | 2019 | | |
2011 | 2020 | | |
2012 | 2021 | | |
2013 | 2022 | | |
| 2023 | + | |
2014 | 2024 | | |
2015 | 2025 | | |
2016 | 2026 | | |
| |||
2025 | 2035 | | |
2026 | 2036 | | |
2027 | 2037 | | |
2028 | | - | |
2029 | 2038 | | |
2030 | 2039 | | |
2031 | 2040 | | |
| |||
2045 | 2054 | | |
2046 | 2055 | | |
2047 | 2056 | | |
| 2057 | + | |
2048 | 2058 | | |
2049 | 2059 | | |
| 2060 | + | |
2050 | 2061 | | |
2051 | 2062 | | |
2052 | 2063 | | |
| |||
2066 | 2077 | | |
2067 | 2078 | | |
2068 | 2079 | | |
| 2080 | + | |
2069 | 2081 | | |
2070 | 2082 | | |
2071 | 2083 | | |
| |||
2097 | 2109 | | |
2098 | 2110 | | |
2099 | 2111 | | |
| 2112 | + | |
2100 | 2113 | | |
2101 | 2114 | | |
| 2115 | + | |
2102 | 2116 | | |
2103 | 2117 | | |
2104 | 2118 | | |
| |||
2118 | 2132 | | |
2119 | 2133 | | |
2120 | 2134 | | |
| 2135 | + | |
2121 | 2136 | | |
2122 | 2137 | | |
2123 | 2138 | | |
| |||
2145 | 2160 | | |
2146 | 2161 | | |
2147 | 2162 | | |
| 2163 | + | |
2148 | 2164 | | |
| 2165 | + | |
2149 | 2166 | | |
2150 | 2167 | | |
2151 | 2168 | | |
| |||
2160 | 2177 | | |
2161 | 2178 | | |
2162 | 2179 | | |
| 2180 | + | |
2163 | 2181 | | |
2164 | 2182 | | |
2165 | 2183 | | |
| |||
2300 | 2318 | | |
2301 | 2319 | | |
2302 | 2320 | | |
| 2321 | + | |
| 2322 | + | |
2303 | 2323 | | |
2304 | 2324 | | |
2305 | 2325 | | |
| |||
0 commit comments