1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! # [`Cleaner`]
//!
//! A [`Cleaner`] is the bulk configuration unit for URL Cleaner Engine. It contains all the logic for how to clean URLs as well as documentation about itself.
//!
//! The following cleaner always removes the `utm_source` query parameter and, if the `https_upgrade` flag is enabled, upgrades HTTP URLs to HTTPS.
//!
//! ```Json
//! {
//! "docs": {
//! "name": "Example cleaner",
//! "description": [
//! "An example cleaner"
//! ],
//! "flags": {
//! "https_upgrade": "Upgrade HTTP URLs to HTTPS"
//! }
//! },
//! "actions": [
//! {"RemoveQueryParam": "utm_source"},
//! {"If": {
//! "if": {"All": [
//! {"FlagIsSet": "https_upgrade"},
//! {"SchemeIs": "http"}
//! ]},
//! "then": {"SetScheme": "https"}
//! }}
//! ]
//! }
//! ```
//!
//! The `docs` field contains the [`CleanerDocs`]. It's optional but polite to add.
//!
//! The omitted [`params`] field contains the [`Params`] used to store configuration data.
//!
//! The omitted [`commons`] field contains the [`Commons`] used to store components used in multiple places.
//!
//! The [`actions`] field contains a list of [`Action`]s to do. The first action, written as [`RemoveQueryParam`](Action::RemoveQueryParam) removes any "utm_source" query param found in the URL.
//!
//! The second action, the [`If`](Action::If) action, applies the action in its [`then`](Action::If::then) field if and only if the condition in its [`if`](Action::If::if) field is "satisfied".
//! In this case, the condition is satisfied if the "https_upgrade" flag is set and the URL's scheme is "http".
//!
//! Unlike AdGuard/uBlock Origin filters, URL Cleaner actions are applied in order of declaration.
//! This has the benefit of letting you build far more complex operations out of far simpler building blocks, but has the downside of being very easy to write slow cleaners.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;