AdguardTeam / CoreLibs

Core Adguard libraries
https://adguard.com/
Apache License 2.0
39 stars 7 forks source link

Incorrect extended CSS rule causes that JS rules don't work #1147

Closed AdamWr closed 4 years ago

AdamWr commented 4 years ago

Steps to reproduce

  1. Add these rules: example.org#?#body > div[class="":has(h1) example.org#%#alert(1);
  2. Go here - http://example.org/

Expected behavior

I think that JS rules should still work.

Actual behavior

JS rules don't work.

The real case is here - https://github.com/AdguardTeam/AdguardFilters/issues/41420 It seems that this rule:

cosmopolitan.lt,moteris.lt,panele.lt,manonamai.lt,tavovaikas.lt,delfi.lt#?#a[href="javascript:void(-1);":-abp-has(a[title="[x] Uždaryti"])

from EasyList Lithuania is inccorect and causes that JS rules don't work.

Screenshot: ![image](https://user-images.githubusercontent.com/29142494/66027861-19f6b180-e4fc-11e9-94c7-44d4d8f52328.png)

Your environment

sxgunchenko commented 4 years ago

css rules validation was improved in core/pull-requests/1860

AdamWr commented 3 years ago

It seems that some rules still cause that problem. I'm not sure if I should open new issue in this repo or maybe create issue in ExtendedCSS repo - https://github.com/AdguardTeam/ExtendedCss/issues, so I'm writing comment here.

Steps to reproduce

  1. Add these rules:
    example.org#?#body:has(div),
    example.org#%#alert(1);
  2. Go here - http://example.org/

Expected behavior

JS rules should still work.

Actual behavior

JS rules don't work.

Screenshot ![image](https://user-images.githubusercontent.com/29142494/94267639-3de8a980-ff3c-11ea-88b3-956295cd7d33.png)