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

add mv3 info in kb #533

Merged
merged 36 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2c97031
add mv3 article
SeverAnna Jul 19, 2024
97cb881
Update docs/adguard-browser-extension/mv3-version.md
vbagirov Jul 26, 2024
ad76762
Changes as per review
vbagirov Jul 26, 2024
c61d481
Merge branch 'agm-2120-add-mv3-article' of https://github.com/Adguard…
vbagirov Jul 26, 2024
1771e18
Update MV3 article
SeverAnna Jul 30, 2024
9cb31c1
add article on unpacked installation + fix mistakes
SeverAnna Jul 31, 2024
acc2a21
fix markdown
SeverAnna Jul 31, 2024
8de4d21
reword and clarify
SeverAnna Jul 31, 2024
c4544a5
change title and file name
SeverAnna Jul 31, 2024
c181f25
change title one more time
SeverAnna Jul 31, 2024
e07dc5f
add MV3 column in 'basic modifiers" table
SeverAnna Aug 7, 2024
a1e89e0
fix markdown
SeverAnna Aug 7, 2024
c8a49f2
changes per request
SeverAnna Aug 8, 2024
2d81ced
Changes as per requests
SeverAnna Aug 12, 2024
057857b
another pack of changes as per requests
SeverAnna Aug 14, 2024
37ad237
merge the parent branch into the current branch, resolve conflicts, a…
slavaleleka Aug 15, 2024
8afc4c1
improve modifiers notes and compatibilities
slavaleleka Aug 15, 2024
24e0c93
fix domain modifier limitation
slavaleleka Aug 15, 2024
555ee12
update caniuse-lite
slavaleleka Aug 15, 2024
5014a14
fix local link
slavaleleka Aug 15, 2024
e8bc202
fix local link
slavaleleka Aug 15, 2024
a71676d
remove ToC+change GH link+delete deprecated modifiers
SeverAnna Aug 16, 2024
3b42e43
Merge branch 'agm-2120-add-mv3-article' of https://github.com/Adguard…
SeverAnna Aug 16, 2024
1ea5aac
fix list
slavaleleka Aug 18, 2024
d2dc61e
Merge branch 'master' into agm-2120-add-mv3-article
slavaleleka Aug 18, 2024
6464ed9
Merge branch 'master' into agm-2120-add-mv3-article
el-termikael Aug 28, 2024
0c9ba05
fix local link
slavaleleka Aug 28, 2024
6f4bc72
fix compatibility tables
slavaleleka Aug 28, 2024
92e2840
change past tense to future tense
el-termikael Aug 28, 2024
c9126c5
update screenshots
SeverAnna Sep 3, 2024
b358981
remove table with modifiers
SeverAnna Sep 3, 2024
37f4c93
change the short names of products to full names
SeverAnna Sep 5, 2024
f75297d
fixes links in sidebar && fixes compatibility tables
105th Sep 9, 2024
1658fd1
fixed linter
105th Sep 9, 2024
433f1e8
fix spaces
slavaleleka Sep 9, 2024
a90bf3c
fix note
slavaleleka Sep 9, 2024
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
100 changes: 100 additions & 0 deletions docs/adguard-browser-extension/mv3-version.md
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a checklist for all changes required in the knowledge base?

This article alone is far from enough so please share the full checklist in private.

Copy link
Member

Choose a reason for hiding this comment

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

Anyone?

Choose a reason for hiding this comment

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

We have a task to create an article about mv3, which should include:

  • main changes in functionality/interface
  • technical information about modifiers
  • an additional article about unpacking mechanics and how to modify static filters, which was mentioned above.
    Also duplicate the link to the task personally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@105th do we?

the task was to add info from Notion
https://www.notion.so/adguard/MV3-2df12c0c086541818013bca0aad627ac
and from the blog

Copy link
Contributor

Choose a reason for hiding this comment

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

a separate column should be added to the compatibility tables as well, isn't it?
https://uploads.adguard.org/slm4F8W0AcDyhUy3X9.png

Copy link
Member

Choose a reason for hiding this comment

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

@SeverAnna this question should be addressed to our PM's.

as i see, we should add at least:

Copy link
Contributor

Choose a reason for hiding this comment

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

@AlinaNaletova @vozersky need your answer here

Copy link
Member

Choose a reason for hiding this comment

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

@el-termikael we already talked about it but i will state it here once again:

That's what we need to finish:

Copy link
Contributor

@el-termikael el-termikael Sep 4, 2024

Choose a reason for hiding this comment

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

@vozersky it would be great if you crate a Jira task for that or update the existing one (AGM-2120)

Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: AdGuard Browser Extension for Chrome MV3
sidebar_position: 5
---

As MV2 extensions are being phased out in the Chrome Web Store, Chrome users may need to switch to MV3 extensions that are compatible with Chrome’s new API Manifest V3. Our thoughts on this topic are extensively discussed on [our blog](https://adguard.com/en/blog/tag/manifest-v3.html).

Our MV3 extension effectively blocks ads and trackers while seamlessly managing social widgets, banners, and video ads. Most users will not notice any operational differences, but there are some limitations and changes to be aware of.

## Where to find our extensions

The **MV3 version** will soon replace our old extension in the [Chrome Web Store](https://chromewebstore.google.com/detail/adguard-adblocker/bgnkhhnnamicmpeenaelnjfhikgbkllg).

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.

## Main changes in features and settings

- **No auto and manual filter updates.** The options *Auto-update filters* and *Check filters update* are no longer available in the *Filters* tab. Since some of the rules are now applied in DNR form, we can’t update filters on request, only through the full process of updating the extension along with the review in the stores.

- **Filtering log**

![Filtering log *border](https://cdn.adtidy.org/content/blog/mv3/new/log.png)

Due to DNR restrictions, we can’t show exactly which rule worked, but we will provide an “approximate rule that was triggered” based on our engine. For precise information, you’ll need to install the “unpacked” form of the extension in your browser yourself. You’ll find detailed instructions on how to do this in a [separate article](adguard-browser-extension/solving-problems/debug-rules).

- *Tracking protection* (formerly known as *Stealth mode*)

![Tracking protection *border](https://cdn.adtidy.org/content/blog/mv3/new/tracking_screen.png)

There are no *Cookies* section, along with *Self-destruction of first-party cookies* and *Self-destruction of third-party cookies* since we cannot set the TTL of cookies using declarative rules.

- *Phishing & malware protection* is no longer available in the general settings. To protect yourself from malicious websites and scams, enable the appropriate filters in the *Security* tab.

![Security](https://cdn.adtidy.org/content/blog/mv3/new/security.png)

## Limitations

### Maximum number of rules and filters

Manifest V3 imposes limits on static and regex rules per extension. Users may receive notifications when these limits are exceeded.

![Rule limits *border](https://cdn.adtidy.org/content/blog/new/rulelimits.png)

![Too many extensions *border](https://cdn.adtidy.org/content/blog/new/other_extension.png)

Basically, Manifest V3 divides rules into static (built-in) and dynamic, with strict limits in place.

**Static rules:** minimum **30,000** rules per extension, with a cumulative limit of **330,000** for all extensions installed by a single user.

For regex rules, the limit is set at **1,000 per extension**.

The maximum number of simultaneously enabled filters is **50**.

**Dynamic rules:** a strict cap of **5,000** rules is imposed, which includes a maximum of 1,000 regex rules.

If this limit is exceeded, only **5,000 converted rules** will be applied in the following order: first allowlist, then user rules, and finally — custom filters.

> **Converted rules** are rules that have been transformed to [DNR](https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest#build-rules) format using the [declarative converter](https://github.com/AdguardTeam/tsurlfilter/tree/master/packages/tsurlfilter/src/rules/declarative-converter). During this conversion process, some rules may overwrite others (`badfilter`), some may be combined (`removeparame`), resulting in a list of rules with a slightly different order.
>
> From this list of converted rules, we will only use 5,000 rules. The rest of them will be displayed in the editor, but not applied.

Here's how a rule with a basic modifier is converted to a declarative rule:

```bash
||example.org^$script,third-party,domain=example.com
```

is converted to

```bash
[
{
"id": 1,
"action": {
"type": "block"
},
"condition": {
"urlFilter": "||example.org^",
"domainType": "thirdParty",
"initiatorDomains": [
"example.com"
],
"resourceTypes": [
"script"
]
},
"priority": 302
}
]
```

More examples can be found on [GitHub](https://github.com/AdguardTeam/tsurlfilter/tree/release/v3.1/packages/tsurlfilter/src/rules/declarative-converter#basic-examples).

### Network rules

Network rules have limitations: some types of rules cannot be implemented in MV3, or can only be implemented with restrictions.

Below is a list of modifiers that are supported, partially supported, or not supported at all. More details about the limitations can be found on [GitHub](https://github.com/AdguardTeam/tsurlfilter/tree/release/v3.1/packages/tsurlfilter/src/rules/declarative-converter). For further information on modifiers, please refer to our [Knowledge base](/general/ad-filtering/create-own-filters/#basic-rules-basic-modifiers).
2 changes: 1 addition & 1 deletion docs/adguard-browser-extension/protected-pages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Browser-protected pages
sidebar_position: 5
sidebar_position: 6
---

:::info
Expand Down
98 changes: 98 additions & 0 deletions docs/adguard-browser-extension/solving-problems/debug-rules.md
SeverAnna marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: How to debug rules in AdGuard for Chrome MV3
sidebar_position: 2
---

In [AdGuard for Chrome MV3](/adguard-browser-extension/mv3-version), the Filtering log only shows the approximate rules that were applied, which we call “assumed rules”. This is because the browser doesn’t provide details about which specific declarative rules were used unless the extension is in an “unpacked” format. To get precise information, you’ll need to install the unpacked version of the extension in your browser yourself.

These instructions are also meant for problematic cases where you want to modify the rules that are bundled with the extension statically. In most cases, using *User rules* in the extension should be sufficient.

## Prerequisites

1. **Git:** [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

1. **Node:** [Install Node.js](https://nodejs.org/en/download/package-manager)

1. **Yarn:** [Install Yarn](https://classic.yarnpkg.com/lang/en/docs/install)

## How to clone extension

1. Clone the repository:

```bash
git clone [email protected]:AdguardTeam/AdguardBrowserExtension.git
```

1. Navigate to the directory:

```bash
cd AdguardBrowserExtension
```

1. Switch to the `v5.0` branch:

```bash
git checkout v5.0
```

1. Install dependencies:

```bash
yarn 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
```

1. The built extension will be located in the directory:

```bash
./build/dev/chrome-mv3
```

## How to install unpacked in the browser

1. Turn on developer mode:

![Developer mode](https://cdn.adtidy.org/content/Kb/ad_blocker/browser_extension/developer_mode.png)

1. Click *Load unpacked*:

![Load unacked](https://cdn.adtidy.org/content/Kb/ad_blocker/browser_extension/load_unpacked.png)

1. Select the extension directory and click `Select`:

![Select](https://cdn.adtidy.org/content/Kb/ad_blocker/browser_extension/select.png)

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.

1. Convert the rules from txt to declarative form:

```bash
yarn convert-declarative
```

1. Build the extension again:

```bash
yarn dev chrome-mv3
```

1. Reload the extension in the browser:

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