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

Support for uBO media queries #1707

Closed
ameshkov opened this issue Dec 18, 2022 · 0 comments
Closed

Support for uBO media queries #1707

ameshkov opened this issue Dec 18, 2022 · 0 comments

Comments

@ameshkov
Copy link
Member

@scripthunter7 commented on Sat Dec 17 2022

uBO now supports media queries. The tsurlfilter's converter does not support it yet.

Reference: https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters#subjectmatches-mediaarg

Examples:

  • example.com###target-3 > .target-4:matches-media((min-width: 1920px) and (min-height: 930px)):style(color: red !important)

    should be converted to

    example.com#$#@media (min-width: 1920px) and (min-height: 930px) { #target-3 > .target-4 { color: red !important; } }
  • github.com##pre:matches-media(print):style(white-space:pre-line !important;)

    should be converted to

    github.com#$#@media (print) { pre { white-space:pre-line !important; } }

FIXME:

  • This is typically an element hiding rule

    example.com###target-1 > .target-2:matches-media((min-width: 800px))

    and perhaps it can be converted to

    example.com#$#@media (min-width: 800px) { #target-1 > .target-2 { display: none !important; } }

    but I'm not sure about that

Reference: https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#examples-9

@slavaleleka Do you have a better idea for the last case? 🙂

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

3 participants