-
Notifications
You must be signed in to change notification settings - Fork 331
issue_674: how to debug rules in AdGuard for Chrome MV3 #700
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
3f5d30e
34d3bda
90caea3
c696d08
af81fe7
ac9aa7c
a6a6f5c
097d427
808fe8d
cb3ae52
9ee69db
5426a57
b088420
ce27b6e
7db5331
9134692
b7036e8
df48ef2
b2df373
921d206
4051f65
c10a2cd
13b6e7e
b8608b8
6e64e8f
dc17f6f
1f88600
1d4361c
8ddfe17
e41b803
bba5f8a
204d01f
93455c5
70675d4
2e1c082
5cc48ee
6d91cd3
5a3de6c
d2b912e
2361571
b40c1e7
3760065
02bf478
dc32b16
c6c9631
34931a0
deea700
d056c00
e2bb049
0178475
bc4b12c
884deca
323c40e
0c5926e
e998409
66219f8
1e2d7a5
45e3269
d0be162
56c1f1b
1826746
f82af86
d904b61
e54a9ce
e0766da
7e6db73
ec32e40
8adfabf
133bcab
99b0ffb
28d010e
9b62ddd
fd43a23
c3ab855
0e5f775
4468483
7dd0786
914a8fe
2bdc6f4
4be3b33
47a42ce
6640044
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ These instructions are also meant for problematic cases where you want to modify | |||||||||
|
|
||||||||||
| 1. **Node:** [Install Node.js](https://nodejs.org/en/download/package-manager) | ||||||||||
|
|
||||||||||
| 1. **Yarn:** [Install Yarn](https://classic.yarnpkg.com/lang/en/docs/install) | ||||||||||
| 1. **pnpm:** [Install pnpm](https://pnpm.io/installation) | ||||||||||
|
|
||||||||||
| ## How to clone extension | ||||||||||
|
|
||||||||||
|
|
@@ -29,30 +29,18 @@ These instructions are also meant for problematic cases where you want to modify | |||||||||
| cd AdguardBrowserExtension | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| 1. Switch to the `v5.0` branch: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| git checkout v5.0 | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| 1. Install dependencies: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| yarn install | ||||||||||
| pnpm install | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## How to build extension | ||||||||||
|
|
||||||||||
| 1. Switch to the `v5.0` branch: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| git checkout v5.0 | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| 1. Run the following command in the terminal: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| yarn dev chrome-mv3 | ||||||||||
| pnpm dev chrome-mv3 | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| 1. The built extension will be located in the directory: | ||||||||||
|
|
@@ -79,20 +67,50 @@ That’s it! | |||||||||
|
|
||||||||||
| ## How to debug rules | ||||||||||
|
|
||||||||||
| 1. Find and modify the rule you need in the `./Extension/filters/chromium-mv3` directory in the `.txt` files. | ||||||||||
| For faster development of DNR rulesets, you can use `@adguard/dnr-rulesets` watch mode, which will automatically rebuild rulesets whenever filter files change: | ||||||||||
|
||||||||||
| For faster development of DNR rulesets, you can use `@adguard/dnr-rulesets` watch mode, which will automatically rebuild rulesets whenever filter files change: | |
| To speed up the development of DNR rulesets, use the `@adguard/dnr-rulesets` watch mode. This mode automatically rebuilds rulesets whenever filter files change: |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. First, build the extension once (just skip, if you did it in the "How to build extension" section): | |
| 1. First, build the extension (skip this step if you already did so in the *How to build extension* section): |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Now, whenever you modify filter files, the DNR rulesets will be automatically rebuilt without having to rebuild the entire extension. | |
| Now, whenever you modify filter files, the DNR rulesets will rebuild automatically, so you won’t have to rebuild the entire extension. |
Outdated
Copilot
AI
May 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider rephrasing the explanation regarding the ❗ mark for improved clarity; breaking it into shorter sentences might help readers better understand the conversion issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. If you see an ❗ mark - it means that assumed rule (which we calculated with our tsurlfilter engine, which performed applying rules in MV2) and actually applied rule (from which we converted to DNR rule) are not the same. And this can be a problem of conversion. <br/> Otherwise, if assumed and applied rules are the same - only applied rule, in raw text and declarative rule views, will be shown. | |
| 1. If you see an exclamation mark, it means the assumed rule (calculated by our tsurlfilter engine using MV2 rules) and the applied rule (converted to a DNR rule) are different. This can be a problem of conversion. | |
| Otherwise, if assumed and applied rules are the same, only applied rule, in raw text and declarative rule views, will be shown. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTML entity <br/> at the end of the file should be replaced with the markdown equivalent (two spaces followed by a newline or an empty line) for better compatibility and readability across different markdown renderers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.