AdguardTeam / SafariConverterLib

Swift library that converts AdGuard rules to Safari content blocking rules
GNU General Public License v3.0
47 stars 15 forks source link

Add the ability to disable first-level domain cosmetic rules with second-level allowlist rules for a specific domain #61

Open piquark6046 opened 5 months ago

piquark6046 commented 5 months ago

Please answer the following questions for yourself before submitting an issue

AdGuard version

4.5.3

Environment

Ad Blocking

No response

Privacy

No response

Social

No response

Annoyances

No response

Security

No response

Other

No response

Language-specific

List-KR

Advanced protection for Safari

Which DNS server do you use?

AdGuard DNS Non-filtering

DNS protocol

DNS-over-QUIC

Custom DNS

No response

DNS filtering

Custom DNS filter

No response

DNS implementation

AdGuard

Tunnel mode

Split-Tunnel

Low-level settings

Bootstrap server: Fallback server: Blocking mode, etc:

Issue Details

Steps to reproduce:

  1. Enable List-KR filters list.
  2. Visit https://board.namu.wiki/
  3. Click one of the posts.

Expected Behavior

The following rules should exclude the normal cosmetic rules at board.namu.wiki.

board.namu.wiki#@#div[class] ~ div div + *[class]:not([class*=" "]) *[class*=" "] div[class]:has(iframe[id^="google_ads_"])
board.namu.wiki#@#div[class] ~ div div + *[class]:not([class*=" "]) *[class*=" "] div[class]:has(iframe[src*="arca.live/external/callad"])
board.namu.wiki#@#div:not([class*=" "]) ~ div div + div[class]:has(> div[id][class])
board.namu.wiki#@#div[class]:not([class*=" "]) ~ div[class*=" "] > *[class*=" "] > *:has(iframe[id^="google_ads_iframe_"])
board.namu.wiki#@#*[class]:not([class*=" "]) > div[class]:not([class*=" "]) ~ *:not([class]) > *[class]:has(iframe[id^="google_ads_iframe_"])
board.namu.wiki#@#*[class]:not([class*=" "]) > div[class]:not([class*=" "]) ~ *:not([class]) > *[class]:has(iframe[src*="arca.live/external/callad"])
board.namu.wiki#@#div[class]:not([class*=" "]) ~ div[class*=" "] > *[class*=" "] > *:has(iframe[src*="arca.live/external/callad"])
namu.wiki##div[class] ~ div div + *[class]:not([class*=" "]) *[class*=" "] div[class]:has(iframe[id^="google_ads_"])
namu.wiki##div[class] ~ div div + *[class]:not([class*=" "]) *[class*=" "] div[class]:has(iframe[src*="arca.live/external/callad"])
namu.wiki##div:not([class*=" "]) ~ div div + div[class]:has(> div[id][class])
namu.wiki##div[class]:not([class*=" "]) ~ div[class*=" "] > *[class*=" "] > *:has(iframe[id^="google_ads_iframe_"])
namu.wiki##*[class]:not([class*=" "]) > div[class]:not([class*=" "]) ~ *:not([class]) > *[class]:has(iframe[id^="google_ads_iframe_"])
namu.wiki##*[class]:not([class*=" "]) > div[class]:not([class*=" "]) ~ *:not([class]) > *[class]:has(iframe[src*="arca.live/external/callad"])
namu.wiki##div[class]:not([class*=" "]) ~ div[class*=" "] > *[class*=" "] > *:has(iframe[src*="arca.live/external/callad"])

Actual Behavior

Allowing the cosmetic rules does not work.

Screenshots

No response

Additional Information

https://github.com/List-KR/List-KR/issues/935

Versty commented 5 months ago

@piquark6046 Hi! Could you please explain which filters in the List-KR contain blocking and unblocking rules you mentioned?

piquark6046 commented 5 months ago

https://github.com/AdguardTeam/SafariConverterLib/issues/61 Here: filters-AG/specific_ELEMHIDE.txt

Versty commented 4 months ago

@piquark6046 Currently unblocking cosmetic rules #@# for subdomains is not supported while the domain is blocked by contrary rule. We will consider improvements to Safari Converter to handle this type of cases.