ContentBlocker icon indicating copy to clipboard operation
ContentBlocker copied to clipboard

User custom filter: CSS selector "has()" does not work

Open snio89 opened this issue 5 years ago • 3 comments

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • [O] I am running the latest version
  • [O] I checked the documentation and found no answer
  • [O] I checked to make sure that this issue has not already been filed

Issue Details

  • AdGuard version:
    • 2.6.0
  • Browser:
    • Samsung Internet
  • Device model:
    • Galaxy Note 10
  • Operating system and version:
    • Android 10

I am not sure this is a bug or a feature that is not yet adapted in the Adguard Content Blocker. CSS selector ':has(selector)' and '[-ext-has="selector"]' do not work in Adguard Content Blocker.

Those filters are listed in the Adguard custom filter guidelines. https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#extended-css-selectors-1

Expected Behavior

  1. Write own filter as follows: google.com##div:has(img[alt="Google"])
  2. Access google.
  3. Nothing shows (tested in PC browser with uBlock)

Actual Behavior

Filter with ":has()" selector is neglected. I've tried ##, #$#, #?#, :has(), and [-ext-has] but none of them worked.

snio89 avatar Mar 17 '20 01:03 snio89

Extended CSS, CSS and JS/Scriptlet rules cannot be used in Content Blocker.

Alex-302 avatar Mar 19 '20 21:03 Alex-302

Chrome 105 (I think Yandex updated Chromium engine enough) added support div:has(img[alt="Google"]), maybe use should be unlocked if app/plugin have something to disable use at all.

krystian3w avatar Dec 12 '22 13:12 krystian3w

I guess we can allow these, but it should be done in https://github.com/AdguardTeam/FiltersCompiler

ameshkov avatar Dec 12 '22 14:12 ameshkov