AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Add a validity checking for element hiding rules #3

Closed ameshkov closed 1 year ago

ameshkov commented 6 years ago

@Alex-302 commented on Mon Dec 12 2016

Current behaviour: The rules, which are placed after invalid rule, are not working. Example of issue: https://forum.adguard.com/index.php?threads/resolved-missed-ad-on-extratorrent.17401/ Screenshot:

![image](http://i65.tinypic.com/9sw64y.jpg)

Invalid rule:

etmirror.com,etproxy.com,extra.to,extratorrent.cc,extratorrent.works,extratorrentlive.com,extratorrentonline.com##td > table[style*=border: 0px"]

table[style*=border: 0px"] - missed the first quotes


@ameshkov commented on Thu Jun 15 2017

I suggest writing a nodejs script which will do this.

  1. You can use nodejs and phantomjs to run an embedded browser and compile a CSS selector.
  2. You can also detect extended css rules and validate them as well using extcss library.