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

body:style breaks cosmetic filters #438

Closed
GHosTiKuS opened this issue Jun 4, 2017 · 5 comments
Closed

body:style breaks cosmetic filters #438

GHosTiKuS opened this issue Jun 4, 2017 · 5 comments

Comments

@GHosTiKuS
Copy link

URL(s) where the issue occurs

https://kurs.com.ua/novost/21233-na-valjutnom-rinke-perelom-trenda/
But it can be everywhere where is cosmetic filters apply

Describe the issue

I can't fully say that this is issue of uBlock or my misunderstanding but when in 'My Filters' i use this '##body:style(background-image: url() !important; overflow: auto !important;)' cosmetic filters are not applied. But when i open logger and from it refresh page cosmetics applies with some delay. Also sometimes it need second refresh to apply or "unaplly".

Screenshot(s)

As i think screenshot will not describe problem truly. Video will be better (if needed)?

Versions

  • Browser/version: Chromium 58.0.3029.110 (64-bit)
  • uBlock Origin version: v1.12.4

Settings

Settings:

  • Disable tooltips (on)
  • I am an advanced user (on)
  • Prevent WebRTC from leaking local IP addresses (on)
    3d-party filters:
  • RUS: BitBlock List (Дополнительная подписка фильтров) (added)
  • RUS: RU AdList (Дополнительная региональная подписка) (added)
    My filters:
  • filter (in description) and other cosmetics

Notes

As i pointed in description i tried catch this "bug" in logger but no luck. Maybe i not clearly understand how to use cosmetic filters with explicit style properties?

@gorhill
Copy link
Member

gorhill commented Jun 4, 2017

##body:style(background-image: url() !important; overflow: auto !important;)

This filter is not valid for two reasons:

  • It's generic, while it should be specific;
  • It has a url() property, not allowed.

See https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#style.

@gorhill
Copy link
Member

gorhill commented Jun 4, 2017

Another issue, is that even with a valid cosmetic filter, the page removes all of uBO's injected styles. This sort of behavior was reported here.

In such case, use Firefox, it does support real user styles.

@gorhill
Copy link
Member

gorhill commented Jun 4, 2017

This also works as far as I can tell:

kurs.com.ua##script:inject(csp.js, script-src https: http: 'unsafe-inline')

@GHosTiKuS
Copy link
Author

You'r great! Thank you for detailed response! With your code i don't even need add to Tampermonkey 'RU Adlist JS Fixes'

@gorhill
Copy link
Member

gorhill commented Jun 4, 2017

I think some functionality are broken on some pages though. Using Firefox is the best fix though, Chromium-based browsers do not support user styles yet, it might even take a while before they do.

@mapx- mapx- closed this as completed Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants