AdguardTeam / ExtendedCss

A TypeScript library for non-standard element selecting — :contains(), :matches-css(), etc., and applying CSS styles with extended properties.
GNU General Public License v3.0
61 stars 9 forks source link

Some ':matches-property()' rules don't work #123

Open AdamWr opened 3 years ago

AdamWr commented 3 years ago

I'm not sure if it's a correct place to report this issue, because it happens only with extensions.

Steps to reproduce:

  1. Add this rule:
    pudelek.pl#?#div[data-testid] div[class*=" "]:matches-property("/__reactInternalInstance/.return.memoizedProps.slotNumber"="/\d+/") 
  2. Go here - https://www.pudelek.pl

This rule should hide ad leftovers, but for some reason it doesn't work with extensions (3.5.31), but works fine with AdGuard for Windows (7.6 nightly 12 (build 3452, CL 1.7.153)).

Screenshot ![image](https://user-images.githubusercontent.com/29142494/104923422-545bba80-599c-11eb-98fa-02424d4ad32d.png)
ameshkov commented 3 years ago

Interesting. @slavaleleka why could it be that way?

AdamWr commented 3 years ago

It seems that the same happens on https://www.facebook.com/ with this rule: facebook.com#?#div:matches-property("/__reactFiber/") It should hide whole website (when you are logged in), but it doesn't work with extensions.

ameshkov commented 3 years ago

Oh, I see. @slavaleleka the problem is that ExtendedCSS is executed in the content script context, it simply does not have access to DOM node properties created in the page context.