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
65 stars 9 forks source link

An issue with `#?#***:style()` rules #92

Closed Alex-302 closed 4 years ago

Alex-302 commented 4 years ago

@Alex-302 commented on Sun Nov 11 2018

Steps to reproduce

Add radikal.ru#?#.render_body_main:style(margin-top: 0 !important) and open https://radikal.ru/lfp/c.radikal.ru/c27/1810/ac/e2cc7c7bc164.jpg/htm

Actual behavior

~display: none; is applied to .render_body_main~ UPD: display: none; is added by site script, and should be removed while page loading. AdGuard prevents to do it.

Your environment


@maximtop commented on Mon Nov 12 2018

@Alex-302 What did you expect from this rule?


@Alex-302 commented on Mon Nov 12 2018

This rule must apply margin-top: 0 !important to .render_body_main, not display: none;. The same with desktop app. But in both cases not all these rules works wrong. #?#.base-page_left-side:style(overflow: auto !important) - correct result; #?#.render_body_main:style(margin-top: 0 !important) - incorrect result(display: none; applied). Is not it ExtCSS bug?


@maximtop commented on Mon Nov 12 2018

#?#.base-page_left-side:style(overflow: auto !important) #?#.render_body_main:style(margin-top: 0 !important) These rules are not supported in extension. Correct work of the first rule is coincidence You should use extended CSS injection mask #$?# in order to apply cosmetic rules

@ameshkov maybe we should support such rules If not then maybe we should warn users that they are incorrect?


@maximtop commented on Wed Nov 14 2018

@Alex-302 if everything is clear with this issue, I close it


@Alex-302 commented on Wed Nov 13 2019

Definitely this is an issue. radikal.ru#?#.render_body_main:style(margin-top: 0 !important) works as it should in uBO.

UPD: added exclusion to this filter on our side radikal.ru#@$?#.render_body_main { margin-top: 0 !important; } so check with radikal.ru#?#body .render_body_main:style(margin-top: 0 !important)


@ameshkov commented on Wed Nov 13 2019

Re-assigned to v3.3_patch1