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

Cosmetic filters randomly ignored #3403

Open
9 tasks done
bimg21 opened this issue Oct 5, 2024 · 14 comments
Open
9 tasks done

Cosmetic filters randomly ignored #3403

bimg21 opened this issue Oct 5, 2024 · 14 comments
Labels
unable to reproduce cannot reproduce the issue

Comments

@bimg21
Copy link

bimg21 commented Oct 5, 2024

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

Lately (last 2-4 weeks) I've been noticing some inconsistencies in the way cosmetic filters are applied (or rather not applied). They are sometimes randomly ignored and elements that have been already blocked are sometimes visible.

This happens on various websites, so it's definitely issue of uBlock, rather than website changing layouts. It most often happens right after creating new cosmetic filter, that after refresh the filter gets ignored, less often it happens with filters that are older.

I should mention that I'm a heavy user, using uBlock to save some screen space from visual clutter on websites I visit often so I currently have over 2600 rows in my filters (and counting). Could that be that uBlock doesn't work well with filters of this length?

A specific URL where the issue occurs.

dell.com
reddit.com
cyberark.com

Steps to Reproduce

  1. Go to a website
  2. Create cosmetic filter
  3. Observe element disappear
  4. Refresh
  5. Observe element being back

Expected behavior

Elements being blocked consistently.

Actual behavior

Elements being blocked inconsistently.

uBO version

1.59.0

Browser name and version

Firefox - 130.0.1 (64-bit) - flatpak

Operating System and version

Linux 6.10.10

@gorhill
Copy link
Member

gorhill commented Oct 5, 2024

Provide a cosmetic filter you created on a specific webpage and which is not working.


The most likely explanation at this point is that you create cosmetic filters with parts that change after a page load, see Element picker does not work, removed element reappears when you reload the page

@bimg21
Copy link
Author

bimg21 commented Oct 5, 2024

For example:
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
##li.dec-card--clickable.dec-card:has-text(ebinar)

After refresh "Webinar"s are still there.

@gorhill
Copy link
Member

gorhill commented Oct 5, 2024

I cannot reproduce.

I added dell.com##li.dec-card--clickable.dec-card:has-text(ebinar) to "My filter" and reloaded the page many time and the element is properly hidden from view.

While on the page https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person, please open uBO's popup panel, click the chat icon, click "Troubleshooting information" on the new page that opens, and copy/paste content here.

@gorhill gorhill added the unable to reproduce cannot reproduce the issue label Oct 5, 2024
@bimg21
Copy link
Author

bimg21 commented Oct 5, 2024

If the issue is in the number of filter rows that preceed this one, it might be only reproduceable with high number of other filters.

Troubleshooting information:

uBlock Origin: 1.59.0
Firefox: 130
filterset (summary):
 network: 239262
 cosmetic: 278133
 scriptlet: 54505
 html: 2268
listset (total-discarded, last-updated):
 removed:
  easyprivacy: null
  plowe-0: null
 added:
  https://hostfiles.frogeye.fr/firstparty-only-trackers-hosts.txt: 11908-0, 5d.6h.29m
  https://malware-filter.gitlab.io/pup-filter/pup-filter.txt: 189-0, 11h.24m
  https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_17_TrackParam/filter.txt: 1733-8, 5d.6h.29m
  https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_3_Spyware/filter.txt: 85375-691, 2d.7h.11m
  https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt: 2678-156, 11h.24m
  https://secure.fanboy.co.nz/fanboy-antifonts.txt: 58-0, 6d.2h.30m
  https://www.i-dont-care-about-cookies.eu/abp/: 25840-4, 1d.6h.34m
  adguard-generic: 84586-5173, 1d.11h.42m
  adguard-mobile: 9835-75, 1d.11h.42m
  adguard-spyware-url: 1730-1721, 1d.11h.43m
  block-lan: 62-0, 5d.1h.26m
  adguard-social: 23179-47, 1d.11h.42m
  [17 lists not shown]: [too many]
 default:
  user-filters: 1358-59, never
  ublock-filters: 40633-180, 1h.13m Δ
  ublock-badware: 11582-6, 1h.13m Δ
  ublock-privacy: 1277-410, 1h.13m Δ
  ublock-unbreak: 2529-54, 1h.13m Δ
  easylist: 85764-2236, 1h.13m Δ
  urlhaus-1: 25350-0, 11h.24m
  ublock-quick-fixes: 162-12, 1h.13m Δ
filterset (user): [array of 1359 redacted]
trustedset:
 added: [array of 8 redacted]
switchRuleset:
 added: [array of 109 redacted]
hostRuleset:
 added: [array of 775 redacted]
 removed:
  behind-the-scene * * noop
  behind-the-scene * image noop
  behind-the-scene * 3p noop
  behind-the-scene * inline-script noop
  behind-the-scene * 1p-script noop
  behind-the-scene * 3p-script noop
  behind-the-scene * 3p-frame noop
userSettings:
 advancedUserEnabled: true
hiddenSettings: [none]
supportStats:
 allReadyAfter: 848 ms (selfie)
 maxAssetCacheWait: 376 ms
 cacheBackend: indexedDB
popupPanel:
 blocked: 6
 no-remote-fonts: true
 network:
  dellcdn.com: 4
  dscx.akamaiedge.net: 2

@gorhill
Copy link
Member

gorhill commented Oct 5, 2024

number of filter rows

There is no need to presume this is an issue. Filter lists contains thousand of cosmetic filters without issue, there are no internal limit for the number of cosmetic filters.

However you have so many lists enabled and other customization that it would help if you could test in a new profile with only default lists. It's possible a bad cosmetic filter in another list not caught by uBO could be causing the issue.

Also just to be sure, please provide the exact filter as it appears in your filter list, ##li.dec-card--clickable.dec-card:has-text(ebinar) is not a valid filter.

@bimg21
Copy link
Author

bimg21 commented Oct 5, 2024

The exact filter is "www.dell.com##li.dec-card--clickable.dec-card:has-text(ebinar)" (added through Element Picker).

After trying different Firefox profile with different filters chosen and adding all my custom My Filters from the original profile, issue is reproduced. New Troubleshooting info:

uBlock Origin: 1.56.0
Firefox: 131
filterset (summary):
network: 231457
cosmetic: 142841
scriptlet: 31904
html: 2269
listset (total-discarded, last-updated):
added:
adguard-spyware-url: 1733-125, now
adguard-spyware: 85381-24229, now
block-lan: 71-0, now
adguard-social: 23187-150, now
adguard-cookies: 32102-66, now
ublock-cookies-adguard: 1785-9, now
adguard-popup-overlays: 28096-881, now
adguard-mobile-app-banners: 5521-11, now
adguard-other-annoyances: 14678-67, now
adguard-widgets: 2688-2, now
ublock-annoyances: 5925-18, now
dpollock-0: 11698-459, now
default:
user-filters: 28-0, never
ublock-filters: 40625-515, now
ublock-badware: 11582-6, now
ublock-privacy: 1277-22, now
ublock-unbreak: 2529-1, now
ublock-quick-fixes: 162-0, now
easylist: 85741-802, now
easyprivacy: 53130-819, now
urlhaus-1: 25330-0, now
plowe-0: 3539-0, now
filterset (user): [array of 28 redacted]
switchRuleset:
added: [array of 1 redacted]
hostRuleset:
added: [array of 4 redacted]
userSettings:
advancedUserEnabled: true
hiddenSettings: [none]
supportStats:
allReadyAfter: 965 ms (selfie)
maxAssetCacheWait: 377 ms
cacheBackend: indexedDB
popupPanel:
blocked: 9
no-remote-fonts: true
network:
dell.com: 3
dellcdn.com: 4
dscx.akamaiedge.net: 2

@gorhill
Copy link
Member

gorhill commented Oct 5, 2024

Can you add www.dell.com##body and see if it works?

If it works, can you try www.dell.com##body:has-text(Dell)?

all my custom My Filters from the original profile

Your other profile says you had 1359 custom filters. The new profile says 28 custom filters.

Can you share those 28 custom filters?


Also, to be sure, can you show me a screenshot of the page with uBO's popup panel opened over it?


Are you using any other extensions which also change the DOM?

@uBlockOrigin uBlockOrigin deleted a comment from uBlock-user Oct 5, 2024
@bimg21
Copy link
Author

bimg21 commented Oct 5, 2024

www.dell.com##body yields white page (I presume that's expected).
www.dell.com##body:has-text(Dell) also.

I copied the Filters with Ctrl+A,C,V and only a few got copied. I tried fixing that mistake with exporting and importing them (into the testing profile), but only a few get imported again. Weird.
When I open the text file, there's really only 69 rows (no pun intended), all of them before first occurence of a number of red dots. Weird!
image

@bimg21
Copy link
Author

bimg21 commented Oct 5, 2024

Btw the dots can be selected but not copied; they don't seem to be a text.

I've noticed them before, presuming they're a sign of copying/importing new filters and do nothing, but could they be behind this issue? Should I delete all of their occurences and retest?

@gorhill
Copy link
Member

gorhill commented Oct 5, 2024

These dots might be zero-width whitespace, see https://en.wikipedia.org/wiki/Zero-width_space. They should not be used in filter lists.

@bimg21
Copy link
Author

bimg21 commented Oct 6, 2024

I never added them manually, I think it was uBlock what added it.

I deleted them which helped so that the Filter export now contains all entries until now. (Strangely enough the filesize of both was almost similar (around 114 kB), even when one had 69 rows and the other 2600 rows)

However the main issue we're working on still persists.

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

Try in a new browser profile, uBO only default settings/lists, no other extension, and only one single custom filter, www.dell.com##li.dec-card--clickable.dec-card:has-text(ebinar). Since I can't reproduce, you will need to narrow down what on your side is causing this, and for this you need to start from the simplest case.

@garry-ut99
Copy link

garry-ut99 commented Oct 6, 2024

bimg21: I never added them manually, I think it was uBlock what added it.

Interesting, I have no idea, I can only say that I noticed zero-width spaces a few times in the past in My filters, but I don't remember where did they come from, I always removed them manually then anyway, I haven't seen them for a long time already.

bimg21: (Strangely enough the filesize of both was almost similar (around 114 kB), even when one had 69 rows and the other 2600 rows)

This means that the both files contained all the filters, just that when importing from the one which contained zero-width spaces, filters behind the zero-width spaces failed to be imported. I'm not sure whether it's a Codemirror's or uBO's quirk, maybe it could be addressed as a bug and fixed on uBO's side, like in a similiar issue:

bimg21: However the main issue we're working on still persists.

Some other guy recently has suffered a similiar issue caused by some of his many filters from "My filters", you can use bisection method like advised to him: uBlockOrigin/uAssets#24776 (reply in thread) to find out which filters cause the issue for you.

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

I think it was uBlock what added it

People who cut & paste content from webpages can ends with these. Nowhere in uBO are there zero-width spaces added to filter text. I suppose it can happen when people cut&paste to manually craft :has-text-based filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unable to reproduce cannot reproduce the issue
Projects
None yet
Development

No branches or pull requests

3 participants