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

::before / ::after no longer hide node as generic filter? #464

Closed
8 tasks done
krystian3w opened this issue Mar 16, 2019 · 18 comments
Closed
8 tasks done

::before / ::after no longer hide node as generic filter? #464

krystian3w opened this issue Mar 16, 2019 · 18 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@krystian3w
Copy link

krystian3w commented Mar 16, 2019

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

##div[class="widget polarisSpid"]::before no longer cut / hide pseudoelements as generic cosmetic filter.

A specific URL where the issue occurs

https://www.folkebladet.no/nyheter/2019/03/15/Kystverket-avsl%C3%A5r-Ytre-%C3%98yfjord-etablering-18661811.ece

https://www.hitra-froya.no/pluss/nyheter/2019/03/15/For-Evaldas-var-nedleggelse-i-nord-starten-p%C3%A5-et-nytt-og-godt-liv-her-i-%C3%B8yregionen-18665600.ece

https://www.rbnett.no/sport/2019/03/14/Etterlyser-bedre-informasjon-fra-klubbene-18660293.ece

https://www.smp.no/nyheter/2019/03/15/Hareid-held-seg-til-%C3%85lesund-18664411.ece

DandelionSprout/adfilt#7 (comment)

Steps to Reproduce

  1. paste to my filters panel:

    ##div[class="widget polarisSpid"]::before
    • save changes
  2. open demo site

  3. blurred on text is still visible:

    obraz

Expected behavior:

recover works filter as generic

Actual behavior:

filter need TLD or domain name to works

Your environment

  • uBlock Origin version: uBO 1.18.6
  • Browser Name and version: Firefox 66 RC3
  • Operating System and version: Windows 7 Pro x64

no affected versions:

uBO <= 1.17.4

@krystian3w krystian3w changed the title :before / :after no longer cut as generic filter? :before / :after no longer cut/hidden as generic filter? Mar 16, 2019
@krystian3w krystian3w changed the title :before / :after no longer cut/hidden as generic filter? ::before / ::after no longer cut/hidden as generic filter? Mar 16, 2019
@krystian3w krystian3w changed the title ::before / ::after no longer cut/hidden as generic filter? ::before / ::after no longer hidden as generic filter? Mar 16, 2019
@uBlock-user uBlock-user added the something to address something to address label Mar 16, 2019
@uBlock-user
Copy link
Contributor

@gwarser Did this work before ?

@uBlock-user
Copy link
Contributor

uBlock-user commented Mar 16, 2019

My Filters shows 0 used out of 0​​​​ after adding it, so it's not getting counted it and it's not gonna getting applied either if it's not getting counted as a filter.

@DandelionSprout
Copy link

I can confirm first-hand that this has been supported since at least July last year, potentially earlier as well. In fact, DandelionSprout/adfilt#7 was in its modest beginnings about an issue that was resolved by using a :before entry.

@DandelionSprout
Copy link

DandelionSprout commented Mar 16, 2019

https://github.com/DandelionSprout/adfilt/blob/master/NorwegianList.txt#L967 through L981 contains several examples of this being applied in regular use, and ##.Article-header-body:before was known (or merely believed, depending on some factors) to work as a generic entry at some point in time.

@THEtomaso
Copy link

I can confirm first-hand that this has been supported since at least July last year, potentially earlier as well.

March 2017?
gorhill/uBlock@cf123b9#diff-3b15596213ed9ba37fb5b8bb1402a6c2

BTW; ##div[class="widget polarisSpid"]:before works just fine in uBO Legacy.

@uBlock-user uBlock-user added bug Something isn't working and removed something to address something to address labels Mar 16, 2019
@gorhill
Copy link
Member

gorhill commented Mar 16, 2019

The filter requires at least one hostname, it can't be used without a hostname. This has been like this since at least Dec 2017, I didn't check earlier.

Edit: This has been like this since gorhill/uBlock#2448 was fixed, it is not true that this is a new behavior.

@THEtomaso
Copy link

THEtomaso commented Mar 16, 2019

This has been like this since gorhill/uBlock#2448 was fixed

If this was the case, then shouldn't uBO Legacy fail to load such generic rules too?

@gorhill
Copy link
Member

gorhill commented Mar 16, 2019

shouldn't uBO Legacy fail to load such generic rules too?

I would expect so. I will have to investigate further then.

@gorhill
Copy link
Member

gorhill commented Mar 16, 2019

Ok I was wrong: it seems this is a regression from gorhill/uBlock@261ef8c.

Meanwhile the workaround is to make the filter specific (which is always the preferred approach anyways).

gorhill added a commit to gorhill/uBlock that referenced this issue Apr 21, 2019
Related issue:
- uBlockOrigin/uBlock-issues#464

Regression from:
261ef8c?diff=unified#diff-3b15596213ed9ba37fb5b8bb1402a6c2R599

Pseudoclass-based generic cosmetic filters were improperly seen
as invalid following the regression.
@uBlock-user uBlock-user added the fixed issue has been addressed label Apr 21, 2019
@krystian3w

This comment has been minimized.

@krystian3w krystian3w changed the title ::before / ::after no longer hidden as generic filter? :before / :after no longer hide node as generic filter? Mar 8, 2020
@gwarser
Copy link

gwarser commented Mar 9, 2020

Cannot test on your example - I don't see it.

Works here:

  • disable JS
  • add ##.gt3_preloader::after
  • load http://jarmarktumski.plock.eu/
  • you will see blank page instead of this gif:

image


Make sure "Ignore generic cosmetic filters" is disabled - I had it on right now ;)

@krystian3w
Copy link
Author

Try found article from Google, also clear cookies for medonet.

@gorhill
Copy link
Member

gorhill commented Mar 9, 2020

These are tests for CSS pseudo elements, they succeed: https://gorhill.github.io/uBlock/tests/css-selector-based-cosmetic-filters.html.

@krystian3w
Copy link
Author

krystian3w commented Mar 9, 2020

OK - I suppose similar glitch AS generic:

##.cookie on body/html tag

When for my filter does not work but @gwarser have sometime blank page (breakage).

@gorhill
Copy link
Member

gorhill commented Mar 9, 2020

medonet.pl##.NTZpopup
medonet.pl##.withNTZpopup::before

Those filters are specific, they are injected unconditionally so they can't suffer from issues affecting generic filters.

@gwarser
Copy link

gwarser commented Mar 9, 2020

@krystian3w it's about this case where targeted class is added dynamically by script and because of this uBO sometimes does not notice - gorhill/uBlock#1885 ?

@krystian3w
Copy link
Author

Yes.

hawkeye116477 added a commit to hawkeye116477/uBlock-for-firefox-legacy that referenced this issue Jan 18, 2021
Related issues:
- uBlockOrigin/uBlock-issues#464
- gorhill#290


Regression from:
4e91155

Pseudoclass-based generic cosmetic filters were improperly seen
as invalid following the regression.

Co-authored-by:  gorhill <585534+gorhill@users.noreply.github.com>
@krystian3w krystian3w changed the title :before / :after no longer hide node as generic filter? :before / :after no longer hide node as generic filter? Feb 2, 2023
@krystian3w krystian3w changed the title :before / :after no longer hide node as generic filter? ::before / ::after no longer hide node as generic filter? Feb 9, 2023
@krystian3w
Copy link
Author

About dropped pseudo-class syntax:

#2483 #2442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

6 participants