Skip to content

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

105th
Copy link
Member

@105th 105th commented May 27, 2025

No description provided.

Copy link

@Copilot Copilot AI left a 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:

![Reload extension](https://cdn.adtidy.org/content/Kb/ad_blocker/browser_extension/reload_extension.png)

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.
Copy link
Preview

Copilot AI May 27, 2025

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

![Reload extension](https://cdn.adtidy.org/content/Kb/ad_blocker/browser_extension/reload_extension.png)

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.
Copy link

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.

Copy link

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested 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:


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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

![Reload extension](https://cdn.adtidy.org/content/Kb/ad_blocker/browser_extension/reload_extension.png)

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link

Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/

@105th 105th requested a review from el-termikael May 28, 2025 18:50
Copy link

Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/

Copy link

Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/

Copy link

github-actions bot commented Jun 4, 2025

Preview was deployed to: https://pull-request-700.kb-adg.pages.dev/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants