Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rules priorities #196

Merged
merged 41 commits into from
Jun 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0205774
added section with rules priorities
105th May 31, 2023
c3c68b6
added notes to other changes
105th May 31, 2023
699a605
Merge branch 'master' into feature/new-rules-priorities
105th May 31, 2023
9e62259
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 1, 2023
c8195c8
fixes
105th Jun 1, 2023
04a1964
sort order of modifiers
105th Jun 1, 2023
221f231
fixes
105th Jun 1, 2023
9b4271b
fixes
105th Jun 1, 2023
aaafa98
fixes
105th Jun 1, 2023
c399370
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 1, 2023
73188ca
fixes
105th Jun 5, 2023
8f69df5
revert changes for $redirect-rules
105th Jun 6, 2023
62e3431
moved $replace to separate category
105th Jun 6, 2023
354dabe
fixes
105th Jun 8, 2023
f677ab3
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 8, 2023
050570e
fixed $all
105th Jun 8, 2023
1c3ea63
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 8, 2023
cda6cd6
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 8, 2023
84025b5
fixed order
105th Jun 8, 2023
0cd3750
fixes
105th Jun 8, 2023
41f9757
fixes
105th Jun 9, 2023
8be61b8
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 9, 2023
11ae08e
fixes
105th Jun 9, 2023
cb93769
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 9, 2023
037e013
removed complicated cases section
105th Jun 9, 2023
8f93977
removed complicated cases
105th Jun 9, 2023
ac4ac2c
fixes
105th Jun 9, 2023
31608ed
fixes
105th Jun 9, 2023
46eb1aa
improved
105th Jun 9, 2023
8bf2ffe
fixes
105th Jun 13, 2023
cd55d3d
fixed
105th Jun 13, 2023
4995e72
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 13, 2023
7e7d252
fixes
105th Jun 13, 2023
efa8a90
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 13, 2023
c27cdf4
Update docs/general/ad-filtering/create-own-filters.md
105th Jun 13, 2023
c851d62
replace `forbidden` with `negated`
105th Jun 13, 2023
9b74e5a
moved $header to group #2
105th Jun 13, 2023
2eddbcc
improved
105th Jun 13, 2023
45697ef
fixed version
105th Jun 13, 2023
bda9464
fixes
105th Jun 13, 2023
9ce3e7a
added notation about aliases
105th Jun 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sort order of modifiers
  • Loading branch information
105th committed Jun 1, 2023
commit 04a196411f230adcd297fdba5cb761bd30f189a0
35 changes: 21 additions & 14 deletions docs/general/ad-filtering/create-own-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -1753,21 +1753,25 @@ The base priority weight of any rule is 1. If the priority is a floating point n

#### 1. Basic modifiers, the presence of each adds 1 to the priority: {#priority-category-1}

* [`$third-party`](#third-party-modifier),
* [`$match-case`](#match-case-modifier),
* [`$to`](#to-modifier),
* [`$method`](#method-modifier),
[//]: # (Please keep them sorted)

* [`$app`](#app-modifier) with forbidden applications using `~`,
* [`$denyallow`](#denyallow-modifier),
* [`$header`](#header-modifier),
* [`$dnsrewrite`](#dnsrewrite-modifier),
* [`$app`](#app-modifier) with forbidden applications using `~`,
* [`$domain`](#domain-modifier) with forbidden domains using `~`,
105th marked this conversation as resolved.
Show resolved Hide resolved
* banned content-types with `~`.
* [`$header`](#header-modifier),
* [`$match-case`](#match-case-modifier),
* [`$method`](#method-modifier),
* [`$third-party`](#third-party-modifier),
105th marked this conversation as resolved.
Show resolved Hide resolved
* [`$to`](#to-modifier),
105th marked this conversation as resolved.
Show resolved Hide resolved
* banned [content-types](#content-type-modifiers) with `~`.

For forbidden `$domain` and content-type, we add 1 for the presence of the modifier itself disregarding the number of forbidden domains or content-types, because the scope of the rule is infinitely large in the limit anyway, in other words, by banning several domains and content-types, we only *insignificantly* narrowed the scope of the rule.
For forbidden domain, app or content-type, we add 1 for the presence of the modifier itself disregarding the number of forbidden domains or content-types, because the scope of the rule is infinitely large in the limit anyway, in other words, by banning several domains and content-types, we only *insignificantly* narrowed the scope of the rule.

#### 2. Defined content types, $popup, special exceptions: {#priority-category-2}
105th marked this conversation as resolved.
Show resolved Hide resolved

[//]: # (Please keep them sorted)

* [`$document`](#document-modifier),
* [`$font`](#font-modifier),
* [`$image`](#image-modifier),
Expand Down Expand Up @@ -1806,15 +1810,16 @@ Specified domains through `$domain` and specified applications through `$app` ad

#### 4. Specific exceptions: {#priority-category-4}

[//]: # (Please keep them sorted)

* [`$content`](#content-modifier),
* [`$elemhide`](#elemhide-modifier),
* [`$extension`](#extension-modifier),
* [`$jsinject`](#jsinject-modifier),
* [`$specifichide`](#specifichide-modifier),
* [`$urlblock`](#urlblock-modifier),
* [`$genericblock`](#genericblock-modifier),
* [`$generichide`](#generichide-modifier),
* [`$extension`](#extension-modifier);
* [`$generichide`](#generichide-modifier);

Each of which adds `10^3` to the priority.
105th marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -1839,13 +1844,15 @@ Modifier [`$important`](#important-modifier) adds `10^6` to rule priority.

#### Rules for which there is no priority count {#priority-category-extra}

[//]: # (Please keep them sorted)

Rules that do not override blocking, but do additional post- or pre-processing of requests:
105th marked this conversation as resolved.
Show resolved Hide resolved
* [`$removeparam`](#removeparam-modifier),
* [`$removeheader`](#removeheader-modifier),
* [`$replace`](#replace-modifier),
* [`$cookie`](#cookie-modifier),
* [`$csp`](#csp-modifier),
* [`$csp`](#jsonprune-modifier);
* [`$jsonprune`](#jsonprune-modifier),
* [`$removeheader`](#removeheader-modifier),
* [`$removeparam`](#removeparam-modifier),
* [`$replace`](#replace-modifier);

Rules that do not need priority:
* [`$badfilter`](#badfilter-modifier),
Expand Down