Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,33 @@ On devices running Realme UI 4.0, there are three key configurations to ensure t
- Find **AdGuard** and enable the **Always-on VPN** option

![Always-on VPN *border](https://cdn.adtidy.org/content/kb/ad_blocker/android/solving_problems/background-work/realme678.png)

## Motorola

On Motorola devices, there are four key configurations to ensure that AdGuard works properly in the background.

1. Allow background usage:

- Go to **Settings → Apps** and find **AdGuard**
- Open **App battery usage**
- Enable **Allow background battery usage**
- Tap the option with the toggle
- Set battery usage to **Unrestricted**

1. Remove background activity restrictions:

- Go to **Settings**
- Scroll down and tap **Apps & notifications**
- Find **AdGuard** and open **Advanced → Battery**
- Tap **Background restriction** or **Background limits**
- If it says **Background activity restricted**, tap it and then tap **Remove**

1. Manage background apps:

- Go to **Settings**, then type **Managing background apps** in the search bar
- Find **AdGuard** and enable the toggle to allow the app to run in the background

1. Disable Adaptive Battery:

- Go to **Settings → Battery**
- Turn off the **Adaptive Battery** option
Original file line number Diff line number Diff line change
Expand Up @@ -43,89 +43,89 @@ AdGuard for Linux requires an [AdGuard license](https://adguard.com/license.html

1. After installation, enter:

```sh
adguard-cli activate
```
```sh
adguard-cli activate
```

2. Then select the desired option:

![adguard-cli activate \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/activation1.png)
![adguard-cli activate \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/1activate.png)

3. Once you have a license, follow the provided link to proceed with the activation:

![Activate license \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/activation2.png)
![Activate license \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/2activate_link.png)

4. After activation, you can continue to work with the program:

![Successful activation \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/activation3.png)
![Successful activation \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/3activate_success.png)

5. You can also reset your license by entering:

```sh
adguard-cli reset-license
```
```sh
adguard-cli reset-license
```

or view the license info by entering
or view the license info by entering

```sh
adguard-cli license
```
```sh
adguard-cli license
```

6. Now you need to set up AdGuard CLI. To run the configuration wizard, enter:

```sh
adguard-cli configure
```
```sh
adguard-cli configure
```

![Setup \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/activation4.png)
![Setup \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/4configure.png)

The wizard will ask basic questions required for the initial setup.
The wizard will ask basic questions required for the initial setup.

7. After that, you can start the AdGuard protection by entering

```sh
adguard-cli start
```
```sh
adguard-cli start
```

![Start protecton \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/activation5.png)
![Start protecton \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/5start.png)

8. You can check the protection status using:

```sh
adguard-cli status
```
```sh
adguard-cli status
```

and stop it with:
and stop it with:

```sh
adguard-cli stop
```
```sh
adguard-cli stop
```

![Stop protecton \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/activation6.png)
![Stop protecton \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/6status-stop.png)

9. To check the current configuration, enter:

```sh
adguard-cli config show
```
```sh
adguard-cli config show
```

![Current setup \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/activation7.png)
![Current setup \*border](https://cdn.adtidy.org/content/Kb/ad_blocker/linux/7config_show.png)

The path to the configuration file will also be displayed, which you can and should edit directly. It contains descriptions of all additional options.
The path to the configuration file will also be displayed, which you can and should edit directly. It contains descriptions of all additional options.

As an alternative, you can use the commands:
As an alternative, you can use the commands:

```sh
adguard-cli config get
```
```sh
adguard-cli config get
```

or:
or:

```sh
adguard-cli config set
```
```sh
adguard-cli config set
```

They are primarily intended for scripting, though.
They are primarily intended for scripting, though.

For further information on the available commands, check out the section [Settings and protection management](https://adguard.com/kb/adguard-for-linux/settings/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,8 @@ Rules with the `$popup` modifier are not supported by AdGuard Content Blocker.

Works the same as the [`$~third-party`](#third-party-modifier) modifier, but only treats the request as first-party if the referrer and origin have exactly the same hostname.

Requests without a referrer are also treated as first-party requests, and the rules with the `$strict-first-party` modifier are applied to such requests.

**Examples**

- domain.com$strict-first-party' — this rule applies only to `domain.com`. For example, a request from `domain.com` to `http://domain.com/icon.ico` is a first-party request. A request from `sub.domain.com` to `http://domain.com/icon.ico` is treated as a third-party one (as opposed to the `$~third-party` modifier).
Expand All @@ -740,6 +742,8 @@ You can use a shorter name (alias) instead of using the full modifier name: `$st

Rules with the `$strict-first-party` modifier are supported by AdGuard for Windows, AdGuard for Mac, AdGuard for Android, and AdGuard for Linux with [CoreLibs][] v1.16 or later.

Requests without a referrer are matched by rules with `$strict-first-party` in AdGuard for Windows, AdGuard for Mac, and AdGuard for Android with [CoreLibs][] v1.18 or later.

:::

#### **`$strict-third-party`** {#strict-third-party-modifier}
Expand Down Expand Up @@ -779,20 +783,28 @@ To be considered as such, a third-party request should meet one of the following

**`$third-party`:**

- `||domain.com^$third-party` — this rule applies to all domains, except `domain.com` and its subdomains. An example of a third-party request: `http://example.org/banner.jpg`.
- `||domain.com^$third-party` — this rule applies to all domains except `domain.com` and its subdomains. The rule is never applied if there is no referrer. An example of a third-party request: `http://example.org/banner.jpg`.

If there is a `$~third-party` modifier, the rule is only applied to the requests that are not from third parties. Which means, they have to be sent from the same domain.
If there is a `$~third-party` modifier, the rule is only applied to requests that are not from third parties. Which means they have to be sent from the same domain or shouldn't have a referrer at all.

**`$~third-party`:**

- `||domain.com$~third-party` — this rule is applied exclusively to `domain.com`. Example of a non third-party request: `http://domain.com/icon.ico`.
- `||domain.com$~third-party` — this rule applies only to `domain.com` and its subdomains. Example of a non third-party request: `http://sub.domain.com/icon.ico`.

Requests without a referrer are also treated as non third-party requests and the rules with the `$~third-party` modifier are applied to such requests.

:::note

You may use a shorter name (alias) instead of using the full modifier name: `$3p`.

:::

:::info Compatibility

Requests without a referrer are matched by rules with `$~third-party` in AdGuard for Windows, AdGuard for Mac, and AdGuard for Android with [CoreLibs][] v1.18 or later.

:::

#### **`$to`** {#to-modifier}

`$to` limits the rule scope to requests made **to** the specified domains and their subdomains. To add multiple domains to one rule, use the `|` character as a separator.
Expand Down Expand Up @@ -3328,6 +3340,26 @@ CSS rules may operate differently [depending on the platform](#cosmetic-rules-pr

:::

:::info Adblock Plus compatibility

In AdGuard products that use **CoreLibs version 1.18 or later**, you can also use element hiding rules to inject a `remove: true` declaration:

```adblock
example.org##body { remove: true; }
```

This usage is discouraged in favor of using [CSS rules](#cosmetic-css-rules) and is only supported for compatibility with filter lists written for Adblock Plus.

Element hiding exceptions (`#@#`) are matched by the selector part only, ignoring the declarations block part. For example, the above rule can be disabled by any of the following exception rules:

```adblock
example.org#@#body
example.org#@#body { remove: true; }
example.org#@#body{remove:true;}
```

:::

### Extended CSS selectors {#extended-css-selectors}

- [Limitations](#extended-css-limitations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,33 @@ On devices running Realme UI 4.0, there are three key configurations to ensure t
- Find **AdGuard** and enable the **Always-on VPN** option

![Always-on VPN *border](https://cdn.adtidy.org/content/kb/ad_blocker/android/solving_problems/background-work/realme678.png)

## Motorola

On Motorola devices, there are four key configurations to ensure that AdGuard works properly in the background.

1. Allow background usage:

- Go to **Settings → Apps** and find **AdGuard**
- Open **App battery usage**
- Enable **Allow background battery usage**
- Tap the option with the toggle
- Set battery usage to **Unrestricted**

1. Remove background activity restrictions:

- Go to **Settings**
- Scroll down and tap **Apps & notifications**
- Find **AdGuard** and open **Advanced → Battery**
- Tap **Background restriction** or **Background limits**
- If it says **Background activity restricted**, tap it and then tap **Remove**

1. Manage background apps:

- Go to **Settings**, then type **Managing background apps** in the search bar
- Find **AdGuard** and enable the toggle to allow the app to run in the background

1. Disable Adaptive Battery:

- Go to **Settings → Battery**
- Turn off the **Adaptive Battery** option
Loading