AdguardTeam / AdguardTeam/CoreLibs

Rules with CSS `@media` rule are considered as unsafe and rejected

Open
#2,098 0 comments 0 reactions 1 assignee Claimed by @ngorskikh View on GitHub
Bug Priority: P4 Version: CoreLibs v1.24
Dominant language
No language data
Stars
52
Forks
10
PR merge metrics
No merged PRs in 30d

Description

### Please answer the following questions for yourself before submitting an issue

- [x] Filters were updated before reproducing an issue
- [x] I checked the [knowledge base](https://adguard.com/kb/) and found no answer
- [x] I checked to make sure that this issue has not already been filed

### AdGuard version

8.1 / CoreLibs: 1.22.29

### Browser version

Any

### OS version

Any

### Issue Details

Steps to reproduce:
1. Open debug log of AdGuard program
2. Search for `#$#@media`

### Expected Behavior

These rules don't contain URLs, and must be accepted as in AdGuard browser extensions.

### Actual Behavior

Rules with `#$#@media` considered as unsafe and rejected

```
WARNING, AdguardSvc.exe, cssfilter is_valid_rule: Rule 'web.joongna.com#$#@media (max-width: 480px) { .max-\[480px\]\:mt-\[73px\] { margin-top: 0 !important; } }' is unsafe and not allowed
WARNING, AdguardSvc.exe, cssfilter cssfilter_addrule: Rule is not valid, ignoring it (web.joongna.com#$#@media (max-width: 480px) { .max-\[480px\]\:mt-\[73px\] { margin-top: 0 !important; } })
WARNING, AdguardSvc.exe, AGProxyFilter addRule: Rule rejected by all filters: web.joongna.com#$#@media (max-width: 480px) { .max-\[480px\]\:mt-\[73px\] { margin-top: 0 !important; } }
WARNING, AdguardSvc.exe, cssfilter is_valid_rule: Rule 'klerk.ru#$#@media (min-width: 1280px) { .desktop\:top-pre-header-height { top: 0 !important; } }' is unsafe and not allowed
WARNING, AdguardSvc.exe, cssfilter cssfilter_addrule: Rule is not valid, ignoring it (klerk.ru#$#@media (min-width: 1280px) { .desktop\:top-pre-header-height { top: 0 !important; } })
WARNING, AdguardSvc.exe, AGProxyFilter addRule: Rule rejected by all filters: klerk.ru#$#@media (min-width: 1280px) { .desktop\:top-pre-header-height { top: 0 !important; } }
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.