Skip to content

Loading…

Whitelisted element may not display as intended #143

Closed
CODYQX4 opened this Issue · 4 comments

2 participants

@CODYQX4

I've noticed that if I whitelist an element, it gets a display: initial !important.

This might not work out if that element is using a different display.

For example on 53.com there is a div#ad-rotator. If I whitelist this, it ceases to be a block element and messes up the layout.

@gorhill

I see.. So the fix is really to have the whitelisted selectors removed from the set of blocked ones, rather than try to re-enable them, as I can't restore for sure their computed display values.

@CODYQX4
@gorhill

Ok, I have a fix.

However, your specific filter would still not work, because I originally made the choice to not support generic exceptions for cosmetic filters: there is no such filters in EasyList or EasyPrivacy. These are rather rare occurrences: for all the lists which ship with uBlock, there are only 8 occurrences of such filters.

Workaround for your specific case is to use: 53.com#@##ad-rotator. Domain- or entity-scoped cosmetic filters are the preferred way for cosmetic filters: Their look-up is more performant, and they can be injected very early in the page.

If I were to enable support, this would add some overhead to the cosmetic filter look-up code, and I rather not introduce a systematic overhead in order to support such rare occurrences.

@CODYQX4
@gorhill gorhill added a commit that closed this issue
@gorhill gorhill this fixes #143 63b3e29
@gorhill gorhill closed this in 63b3e29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.