-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the new ABP syntax Inline CSS
and Remove
#415
Comments
Some rules don't work in Brave because of some issues (as explained in brave/brave-browser#42873) with Procedural Cosmetics not being parsed properly, if rules are tested individually, they will work fine, but some are dropped when they are being parsed in a big group. The next are just Incompatible ruleshttps://abptestpages.org/en/filters/remove-extended or https://abptestpages.org/en/filters/inline-css-extended Caution abptestpages.org#?#div > div:-abp-contains(/remove-containsregex\d/):remove()
abptestpages.org#?#div > div:-abp-contains(/inline-css-containsregex\d/):style(background-color: #0dc74b !important;) Brave Warning abptestpages.org#?#span:xpath(//*[@id="basic-xpath-usage-with-remove-fail"]):remove()
abptestpages.org#?#span:xpath(//*[@id="basic-xpath-usage-with-inline-css-fail"]):style(background-color: #0dc74b !important;) Doesn't work because abptestpages.org#?#:xpath(//span[@id="basic-xpath-usage-with-remove-fail"]):remove()
abptestpages.org#?#span:xpath(//span[@id="basic-xpath-usage-with-inline-css-fail"]):style(background-color: #0dc74b !important;) will work in both uBlock and Brave. https://abptestpages.org/en/filters/remove-extended-inversion or https://abptestpages.org/en/filters/inline-css-extended-inversion Caution abptestpages.org#?#.removei-contains:not(span:-abp-contains(example-content)):remove()
abptestpages.org#?#.inline-css-inv-contains:not(span:-abp-contains(example-content)):style(background-color: #0dc74b !important;) Brave So, something simple as this will not work in Brave: abptestpages.org##.site-panel > :not(:has-text(Remove)) Caution abptestpages.org#?#.removei-contains-regex:not(span:-abp-contains(/example-contentregex\d/)):remove()
abptestpages.org#?#.inline-css-inv-contains-regex:not(span:-abp-contains(/example-contentregex\d/)):style(background-color: #0dc74b !important;) Same issues as having |
Also, why is It took a second to test that and most rules will be compatible are now compatible, some rules don't seem to work or be read the same as ABP, like: But most rules work by just doing that little change, with all the other exceptions about Brave procedural filters and all that, For example, using https://abptestpages.org/en/filters/element-hiding-emulation is not the best example, but not all rules will be written like in that example and they would be compatible with Brave and uBlock. For example for this list to work in uBlock and Brave, I had to modify a lot of things, like width would need the computed value, while ABP would only see the one in the CSS, Brave lacks regex support in the value of abptestpages.org#?#div:-abp-properties(width: 213px)
abptestpages.org#?#div:-abp-has(>div>span.ehe-abp-has)
abptestpages.org#?#div:has(>div>span.ehe-has)
abptestpages.org#?#span:-abp-contains(ehe-contains-target)
abptestpages.org#?#span:xpath(//*[@id="basic-xpath-usage-fail"])
abptestpages.org#?#span:has-text(ehe-has-text)
abptestpages.org#?#div:-abp-has(> div:-abp-properties(width: 214px))
abptestpages.org#?#div:-abp-properties(WiDtH: 215px)
abptestpages.org#?#.ehe-wildcard:-abp-properties(cursor:*)
abptestpages.org#?#div:-abp-properties(/width: 12[1-5]px;/)
abptestpages.org#?#div > div:-abp-contains(/ehe-containsregex\d/) to this: abptestpages.org#?#div:matches-css(width: 537.5px)
abptestpages.org#?#div:-abp-has(>div>span.ehe-abp-has)
abptestpages.org#?#div:has(>div>span.ehe-has)
abptestpages.org#?#span:-abp-contains(ehe-contains-target)
abptestpages.org#?#span:xpath(//span[@id="basic-xpath-usage-fail"])
abptestpages.org#?#span:has-text(ehe-has-text)
abptestpages.org#?#div:-abp-has(> div:matches-css(width: 214px))
abptestpages.org#?#div:matches-css(width: 538.5px)
abptestpages.org#?#.ehe-wildcard:matches-css(cursor:/.?/)
abptestpages.org#?#div:matches-css(width: /24[3-7]\.5px/)
abptestpages.org#?#div > div:-abp-contains(/ehe-containsregex\d/) Made most rules compatible. And individually targetting the incompatible ones like - abptestpages.org#?#div:-abp-has(> div:matches-css(width: 214px))
+ abptestpages.org#?#div > div:matches-css(width: 214px):upward(1)
- abptestpages.org#?#.ehe-wildcard:matches-css(cursor:/.?/)
+ abptestpages.org#?#.ehe-wildcard:matches-css(cursor: pointer)
- abptestpages.org#?#div > div:-abp-contains(/ehe-containsregex\d/)
+ abptestpages.org#?#div > div:-abp-contains(/ehe-containsregex/) will make all but one rule compatible But I think would not be a terrible move to add also |
Recently uBlock added support for the new ABP syntax where:
Remove:
{remove: true;}
=:remove()
Inline CSS:
{css-declaration}
=:style(css-declaration !important;)
which can be tested in https://abptestpages.org, but take 3 seconds to do in VSCode:
ABP
Brave
The text was updated successfully, but these errors were encountered: