-
Notifications
You must be signed in to change notification settings - Fork 239
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?
Conversation
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.
Pull Request Overview
This PR updates the documentation for debugging rules in the AdGuard Browser Extension for Chrome MV3. It replaces Yarn with pnpm in various commands, adds instructions for using the @adguard/dnr-rulesets watch mode for faster rule development, and clarifies the renaming of the old beta MV2 extension.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
docs/adguard-browser-extension/solving-problems/debug-rules.md | Replaced Yarn commands with pnpm and added detailed instructions to use the watch mode for DNR rulesets. |
docs/adguard-browser-extension/mv3-version.md | Updated the text regarding the renaming of the old beta extension. |
1. Reload the extension in the browser: | ||
|
||
 | ||
|
||
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. |
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.
Copilot uses AI. Check for mistakes.
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. |
1. Reload the extension in the browser: | ||
|
||
 | ||
|
||
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. |
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.
Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/ |
@@ -13,7 +13,7 @@ The **MV3 version** has replaced our old extension in the [Chrome Web Store](htt | |||
|
|||
The **beta version of MV3** will still be available in the [Chrome Web Store](https://chromewebstore.google.com/detail/adguard-adblocker-mv3-exp/apjcbfpjihpedihablmalmbbhjpklbdf). | |||
|
|||
The old beta extension will be renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and will be supported until Google phases it out. | |||
The old beta extension was renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and will be supported until Google phases it out. |
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 old beta extension was renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and will be supported until Google phases it out. | |
The old beta extension was renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and may no longer be supported by Google. |
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 old beta extension was renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and will be supported until Google phases it out. | |
The old beta extension has been renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and may no longer be supported by Google. |
@@ -13,7 +13,7 @@ The **MV3 version** has replaced our old extension in the [Chrome Web Store](htt | |||
|
|||
The **beta version of MV3** will still be available in the [Chrome Web Store](https://chromewebstore.google.com/detail/adguard-adblocker-mv3-exp/apjcbfpjihpedihablmalmbbhjpklbdf). | |||
|
|||
The old beta extension will be renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and will be supported until Google phases it out. | |||
The old beta extension was renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and will be supported until Google phases it out. |
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 old beta extension was renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and will be supported until Google phases it out. | |
The old beta extension has been renamed to [**AdGuard Ad Blocker MV2**](https://chromewebstore.google.com/detail/adguard-adblocker-beta/gfggjaccafhcbfogfkogggoepomehbjl) and may no longer be supported by Google. |
@@ -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: |
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.
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: |
|
||
1. Convert the rules from txt to declarative form: | ||
1. First, build the extension once (just skip, if you did it in the "How to build extension" section): |
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): |
``` | ||
|
||
1. Now, whenever you modify filter files, the DNR rulesets will be automatically rebuilt without having to rebuild the entire extension. |
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. |
1. Reload the extension in the browser: | ||
|
||
 | ||
|
||
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. |
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. |
Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/ |
Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/ |
Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/ |
Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/ |
No description provided.