uBlock/src/css
Raymond Hill bde3164eb4
Add support for 1P, 3P, header= filter options and other changes
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=`
2020-11-23 08:22:43 -05:00
..
fonts More work toward redesigning the UI 2020-04-21 16:33:08 -04:00
themes Add support for 1P, 3P, header= filter options and other changes 2020-11-23 08:22:43 -05:00
1p-filters.css Replace CodeMirror resize code with CSS flex 2020-04-25 10:19:08 -04:00
3p-filters.css Ensure the bottom of dashboard panes is visible 2020-10-21 12:50:24 -04:00
about.css Fine tune built-in benchmark 2020-10-27 12:59:31 -04:00
advanced-settings.css Replace CodeMirror resize code with CSS flex 2020-04-25 10:19:08 -04:00
asset-viewer.css Revisit the behavior of the click-to-subscribe content script 2020-09-13 08:01:53 -04:00
click2load.css Allow to scroll for URL in click-to-load 2020-11-14 11:59:06 -05:00
cloud-ui.css Add more CSS variables for theming 2020-10-03 06:00:48 -04:00
codemirror.css Add support for 1P, 3P, header= filter options and other changes 2020-11-23 08:22:43 -05:00
common.css Add more CSS variables for theming 2020-10-03 06:00:48 -04:00
dashboard-common.css Add new advanced setting: uiStyles 2020-05-19 10:33:36 -04:00
dashboard.css Revisit the behavior of the click-to-subscribe content script 2020-09-13 08:01:53 -04:00
document-blocked.css Drop CSS styles already define in common.css 2020-11-06 12:26:12 -05:00
dyna-rules.css Fix misaligned label 2020-08-25 13:46:36 -04:00
epicker-ui.css Fix scrollbar not receiving mouse event in element picker 2020-11-20 11:37:00 -05:00
fa-icons.css More work toward re-hauling the user interface 2020-04-27 10:33:49 -04:00
logger-ui-inspector.css Add advanced setting to force a light/dark theme 2020-10-03 07:13:40 -04:00
logger-ui.css Improve representation of modifier filters in logger 2020-11-20 07:14:02 -05:00
popup-fenix.css Improve layout of popup panel when rendered in a tab 2020-10-18 10:00:55 -04:00
popup.css Add missing ; 2020-05-15 09:39:48 -04:00
settings.css Ensure the bottom of dashboard panes is visible 2020-10-21 12:50:24 -04:00
shortcuts.css Sixth pass to re-design the dashboard 2020-04-13 09:19:58 -04:00
whitelist.css Replace CodeMirror resize code with CSS flex 2020-04-25 10:19:08 -04:00