Skip to content
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

Cosmetic rules can be used as CSS rules #1293

Closed
AdamWr opened this issue Apr 16, 2020 · 11 comments
Closed

Cosmetic rules can be used as CSS rules #1293

AdamWr opened this issue Apr 16, 2020 · 11 comments

Comments

@AdamWr
Copy link
Member

AdamWr commented Apr 16, 2020

I mean that at the moment we can also use ## instead of #$# and CSS rule will be applied.

Steps to reproduce:

  1. Add this rule:
    example.org##body { background: red!important; }
  2. Go to - http://example.org/

It also allows to use url(...) and if I understand correctly it shouldn't be allowed - #1026, #659 (comment)

Example:

example.org##body { background: lightblue url("https://www.w3schools.com/cssref/img_tree.gif") no-repeat fixed center!important; }
Screenshot

image

AdGuard for Windows 7.4 nightly 17 (build 3185, CL 1.5.241)

@ameshkov
Copy link
Member

@sxgunchenko please check what's wrong with the element hiding rules validation

@sxgunchenko
Copy link

ok

@sxgunchenko
Copy link

core/pull-requests/1835

@AdamWr
Copy link
Member Author

AdamWr commented Apr 22, 2020

It seems that it's still possible.
Example:

example.org##body\{\}, body { background: lightblue url("https://www.w3schools.com/cssref/img_tree.gif") no-repeat fixed center!important; }
Screenshot

image

@sxgunchenko
Copy link

thanks, fixed in core/pull-requests/1855

@AdamWr
Copy link
Member Author

AdamWr commented Apr 28, 2020

Probably one more example:

example.org##body /*({})*/ { background: lightblue url("https://www.w3schools.com/cssref/img_tree.gif") no-repeat fixed center!important; }
Screenshot

image

It also works with CSS rules #$#, but I think it shouldn't:

example.org#$#body /*({})*/ { background: lightblue url("https://www.w3schools.com/cssref/img_tree.gif") no-repeat fixed center!important; }

@sfionov sfionov reopened this Apr 28, 2020
@sxgunchenko
Copy link

fixed in core/pull-requests/1872

@AdamWr
Copy link
Member Author

AdamWr commented May 1, 2020

Seems to be still possible:

example.org##\\/*[*/, body { background: lightblue url("https://www.w3schools.com/cssref/img_tree.gif") no-repeat fixed center!important; } ,\/*]
Screenshot

image

@ameshkov ameshkov reopened this May 1, 2020
@ameshkov
Copy link
Member

ameshkov commented May 1, 2020

@AdamWr good job!

@sxgunchenko
Copy link

fixed in core/pull-requests/1883

@AdamWr
Copy link
Member Author

AdamWr commented May 9, 2020

One more example:

example.org##body:not(blabla/*[*/) { background: lightblue url("https://www.w3schools.com/cssref/img_tree.gif") no-repeat fixed center!important; } /*]*\/
Screenshot

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants