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

Generic cosmetic filters abruptly not applied #2011

Closed
laniakea64 opened this issue Sep 20, 2016 · 12 comments
Closed

Generic cosmetic filters abruptly not applied #2011

laniakea64 opened this issue Sep 20, 2016 · 12 comments
Labels

Comments

@laniakea64
Copy link

Describe the issue

Generic cosmetic filters are not applied to topics on phpBB forums after visiting more than 15 topics on which said generic cosmetic filters would have no effect.

One or more specific URLs where the issue occurs

https://forums.informaction.com/viewtopic.php?f=18&p=84348#p84348

Steps for anyone to reproduce the issue

  1. add custom filter ##[href*="github.com"]
  2. visit more than 15 topics on https://forums.informaction.com/ that do not have links to github
  3. visit a topic there which does have a link to github, such as above-mentioned URL

Expected results: github link is hidden

Actual results: github link is visible, and the cosmetic filter is not reported in the logger.


(Related discussion on informaction: https://forums.informaction.com/viewtopic.php?f=18&t=21619&start=30#p84250 )

Your settings

new profile

  • Browser/version: SeaMonkey 2.40
  • uBlock Origin version: 1.9.6
Your filter lists

default

Your custom filters (if any)

see above

@ghost
Copy link

ghost commented Oct 27, 2016

@gorhill

Generic Filters are not being applied.

Steps

Go to http://the-watch-series.to/

Right click on "Latest Popular Episodes" block and click Block Element

Select and apply Cosmetic Filter "##.block-left-home-title"

Now browse to "chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/dashboard.html#1p-filters.html"

Remove the website name from the cosmetic filter which will turn it into a generic filter and click Apply Changes.

Refresh the web page, and the "Latest Popular Episodes" block will be back.

Add the website name back as and the cosmetic filter will be applied successfully again.

PS - Ignore generic cosmetic filters is NOT activated and this still happens, so I guess the bug lies somewhere there. This is happening still with version 1.9.16

@gorhill
Copy link
Owner

gorhill commented Oct 27, 2016

Refresh the web page, and the "Latest Popular Episodes" block will be back

Completely unrelated to the issue here. See the logger: @@||the-watch-series.to^$elemhide, from EasyList.

@ghost
Copy link

ghost commented Oct 27, 2016

Is that why generic filters are not being applied ? because of that $elemhide flag ?

Also if that's the case then how come specific site filters are still being applied like this one - the-watch-series.to###header-2 ?

@gorhill
Copy link
Owner

gorhill commented Oct 27, 2016

because the filter applied is really @@||...$generichide, not elemhide. Historically uBO never supported elemhide, it was always implemented as generichide, which was something added by ABP afterward. I just need to change all instances of elemhide to generichide.

@ghost
Copy link

ghost commented Oct 27, 2016

Ah, I understand now. Also there was hardly any documentation on this one, so I had to ask.

With those changes, can we still use elemhide instead of generichide ?

@gorhill
Copy link
Owner

gorhill commented Oct 27, 2016

Yes, elemhide will always map internally to generichide. I just modified the code to report properly in the logger generichide instead of elemhide.

@ghost
Copy link

ghost commented Oct 27, 2016

Thanks for that. One more question, like for a cosmetic filter namely, example.com##.blah we can do example.com#@#.blah to disable that cosmetic filter, so is there something for $elemhide/$generichide too ?

@gorhill
Copy link
Owner

gorhill commented Oct 27, 2016

Currently you can't override a filter such as @@||example.com^$generichide -- looks like I put code in there long time ago to disregard filters such as ||example.com^$generichide, because such filter is implicit, i.e. not required since cosmetic filtering is always enabled by default according to ABP-filtering semantic.

However, since uBO supports the important filter option, which means theoretically it should be possible for UBO to override an exception filter such as @@||example.com^$generichide. Probably best to open a separate issue for this.

@ghost
Copy link

ghost commented Oct 27, 2016

Hmmm, thought so. I did try ||the-watch-series.to^$elemhide,important, and nothing happened. I guess I will open a new issue hereon forward.

@yourduskquibbles
Copy link

yourduskquibbles commented Oct 27, 2016

Hi @gorhill I run a ' Web Annoyances' filter list and have a similar experience with generic filters on all websites that use the 'medium.com' blog platform as well as other sites that use their platform.

Use case can be tested on the link below: https://medium.com/buzzfeed-collections/internets-favorite-congressman-b7002ad4f3fa#.f3upjdryx

When I add the following generic filter with no domain name in front of the ## to 'My Filters' ##.is-maximized.metabar--affixed.is-hiddenWhenMinimized.is-withBottomSection.u-tintSpectrum.u-tintBgColor.u-textColorTransparentWhiteDarker.js-metabar.u-clearfix.metabar the filter seems to have no impact and ignores the rule.

However, if I use the same cosmetic filter, but include the domain, uBO seems to work as intended (i.e. medium.com##.is-maximized.metabar--affixed.is-hiddenWhenMinimized.is-withBottomSection.u-tintSpectrum.u-tintBgColor.u-textColorTransparentWhiteDarker.js-metabar.u-clearfix.metabar

You can test the impact of what this filter is attempting to block by scrolling down a little bit on the page and then scrolling up, with no filter set, or the generic filter without a domain. You should see a navbar overlay descend from the top of the page. However, when you use a domain in front of the generic filter, the filter applies and the navbar is no longer visible.

The only sites I have seen uBO work this way are on the medium blog platform, so impacted sites for example would be medium.com, backchannel.com, theringer.com, timeline.com, wearemel.com, howwegettonext.com, etc.

The other curious thing, is that it ONLY seems to impact the top navbar, other generic elements that are shared between medium blog platform sites can be blocked without a domain in front of the cosmetic filter so I'm not sure why the navbar cosmetic filter doesn't apply when there is no domain prefix. You can test that other generic elements are being blocked without the domain name by setting the following filter that gets used by all of the domains listed above.

##.is-visible.js-postActionsBar.postActionsBar
##.js-postActionsBarContent.row.postActionsBar-content
##.promoCard

Test articles to show the 3 generic filters above are being applied across multiple domains that use the medium platform could be the following links:
https://theringer.com/chris-mortensen-espn-cancer-f2120a2a35cc#.lrebr1lzb
https://howwegettonext.com/translating-identity-across-the-language-barrier-66a87163a8e1#.i7ve001du
https://medium.com/buzzfeed-collections/internets-favorite-congressman-b7002ad4f3fa#.f3upjdryx

The preceding generic filters will block a couple different 'fly-in' boxes at the end of an article and WORK without a domain name prefix for articles on any of the previously listed domains (medium.com, backchannel.com, theringer.com, timeline.com, wearemel.com, howwegettonext.com, etc.) that use the medium blog platform.

Please note, from what I have found, the medium sites use different navbar or what medium seems to call 'metabar' element names such as the following (there are more, but don't need to post them all probably):
##.is-maximized.is-transitioning.metabar--affixed.u-tintSpectrum.u-tintBgColor.metabar--tall.metabar--dark.js-metabar.u-clearfix.metabar

##.is-maximized.metabar--affixed.is-hiddenWhenMinimized.is-withBottomSection.u-tintSpectrum.u-tintBgColor.u-textColorTransparentWhiteDarker.js-metabar.u-clearfix.metabar

##.is-maximized.metabar--affixed.js-metabar.u-clearfix.metabar

but none of the navbar filters will work without a domain in front of the cosmetic filter.

Sorry if this is a long post, and I hope I clearly explain what the issue is and how to replicate the generic filters not being applied in certain situations. Please let me know if I can provide further information.

@gorhill
Copy link
Owner

gorhill commented Oct 27, 2016

@yourduskquibbles See #1885.

Repository owner locked and limited conversation to collaborators Oct 27, 2016
@gorhill
Copy link
Owner

gorhill commented Oct 27, 2016

It's always best to use specific cosmetic filters -- the generic ones should be avoided as much as possible. Generic cosmetic filters is what led to ABP et al. to inject 17,000+ (as of writing) into every page and every frame on a page.

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

No branches or pull requests

3 participants