AdguardTeam / CoreLibs

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

Allow negative selection of tagName (and possibly special attributes) for HTML filtering #1935

Open Yuki2718 opened 4 days ago

Yuki2718 commented 4 days ago

Issue Details

In relation to https://github.com/AdguardTeam/CoreLibs/issues/1934 if scripts are like

<script async="" src="test1.js"></script>
<script src="test2.js"></script>

allow to remove test2.js with something like :not() pseudo selector e.g. example.org$$script[src="test"]:not([async]) and/or example.org$$script[src="test"]:not([async=""]).

Proposed solution

Allow to select tags not having specified attirbute(s)/value(s) (or possibly special attributes such as :contains())

Alternative solution

CSS-like forward-, backward- , or exact matching to attributes (if not regex) will also help if possible.