SafariConverterLib icon indicating copy to clipboard operation
SafariConverterLib copied to clipboard

Some rules are converted incorrectly and disable element hiding rules

Open AdamWr opened this issue 10 months ago • 4 comments
trafficstars

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 and found no answer
  • [X] I checked to make sure that this issue has not already been filed

AdGuard version

4.5.8

Environment

  • OS: 18.2
  • Device: iPad

Ad Blocking

No response

Privacy

No response

Social

No response

Annoyances

No response

Security

No response

Other

No response

Language-specific

No response

Advanced protection for Safari

  • [X] yes, I do

Which DNS server do you use?

DNS protection disabled

DNS protocol

DNS protection disabled

Custom DNS

No response

DNS filtering

  • [X] yes, I do

Custom DNS filter

No response

DNS implementation

DNS protection disabled

Tunnel mode

DNS protection disabled

Low-level settings

Bootstrap server: Fallback server: Blocking mode, etc:

Issue Details

Related to - https://github.com/AdguardTeam/AdguardFilters/issues/194857#issuecomment-2567146140 It looks like that since version 4.5.8 sponsored ads are not blocked correctly on google.com, and it's probably due to incorrectly converting rules.

Steps to reproduce:

  1. Disable all filter lists
  2. Add these rules to user rules:
@@http://adwords.google.$document,domain=google.com
google.com##body
  1. Go to https://www.google.com/

Expected Behavior

Content should be hidden by google.com##body rule, but it looks like that this rule - @@http://adwords.google.$document,domain=google.com causes that element hiding rule doesn't work.

Actual Behavior

Content is not hidden.

Screenshots

No response

Additional Information

Logs from previous (4.5.7) and current version (4.5.8) below (thank you @Alex-302).

JSON 4.5.7 version
[{
    "trigger": {
        "url-filter": ".*",
        "if-domain": ["*google.com"]
    },
    "action": {
        "type": "css-display-none",
        "selector": "body"
    }
}, {
    "trigger": {
        "url-filter": "http:\\/\\/adwords\\.google\\.",
        "if-domain": ["*google.com"]
    },
    "action": {
        "type": "ignore-previous-rules"
    }
}]
JSON 4.5.8 version
[{
    "trigger": {
        "url-filter": ".*",
        "if-domain": ["*google.com"]
    },
    "action": {
        "type": "css-display-none",
        "selector": "body"
    }
}, {
    "trigger": {
        "url-filter": ".*",
        "if-domain": ["*google.com", "*adwords.google."]
    },
    "action": {
        "type": "ignore-previous-rules"
    }
}]

AdamWr avatar Jan 02 '25 19:01 AdamWr