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

Closed
9 tasks done
bimg21 opened this issue Oct 5, 2024 · 38 comments
Closed
9 tasks done

Cosmetic filters randomly ignored #3403

bimg21 opened this issue Oct 5, 2024 · 38 comments
Labels
fixed issue has been addressed

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.

@bimg21
Copy link
Author

bimg21 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).

In this case the filter worked. (I didn't even change the filter lists, only deleted all other custom filters)

This means that the both files contained all the filters, just that when importing

Actually, no. Even when opening the .txt file in text editor, it only had 69 rows.

...you can use bisection method like advised to him...

Hmm, you mean comment out 1300 lines manually one by one, then 650 and so on? That'd be awful lot of work. Could the problem be pinpointed from Logger or Troubleshooting information?

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.

I've only started crafting ':has-text' and similar filters in recent months, but the whitespaces appeared between 2023-04-09 and 2023-04-13, maybe this was how uBlock marked that new filters were imported...? (Like when adding desktop filters into Android installation and vice versa)

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Oct 6, 2024

There's no line in uBO's code that adds zero-width spaces.

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

maybe this was how uBlock marked that new filters were imported

You keep making presumptions, this is not the way to go. It's detective work, makes no assumption and narrow down as much as possible by using bisection. I've done that in the past with tens of thousands of filters to find the one culprit filter causing an issue, it's the only way to get to the bottom of it. If you do not want to do it, I can do it if you share your custom filters in a text file which I can copy/paste to "My filters" and see if I can reproduce on my side. If I can, then I will do the bisect.

@bimg21
Copy link
Author

bimg21 commented Oct 6, 2024

Here is a log of the website where it does not get blocked:
`

Logger output

+5
www.dell.com
1
get
script
https://www.dell.com/content/dam/web-resources/project-specific/events-calendars/events-calendar-2021/card-c22c00d5cf56bbacae8c.js
+4
www.dell.com
1
get
image
https://www.dell.com/en-us/internalservererror?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F
+4
www.dell.com
1
get
image
https://www.dell.com/content/public/error.aspx?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F?originalURL=www.dell.com%2Fetc%2Fdesigns%2Fuwaem%2Fassets%2Fimg%2Ffavicons%2Fapple-touch-icon-180x180.png%3F
+4
www.dell.com
1
get
image
https://www.dell.com/etc/designs/uwaem/assets/img/favicons/favicon-16x16.png
+4
www.dell.com
1
get
image
https://www.dell.com/etc/designs/uwaem/assets/img/favicons/apple-touch-icon-180x180.png
+4
no-remote-fonts: * true
--
www.dell.com
1
get
inline-font
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
+4
www.dell.com
1
get
xhr
https://www.dell.com/cs-cz/dt/configuration-page/forms-validation.htm
+4
www.dell.com
3
get
image
https://e13665.dscx.akamaiedge.net/
aliasURL=https://www.delltechnologies.com/content/dell-assetshare/login.htm?resource=%2Fcontent%2Fdam%2Fss2%2Fproduct-images%2Fpage%2Fuber%2FDTW_24_Dellcom_Banners_EventsPage_Desktop_1920x600.jpg%3Fnull&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown
+4
www.dell.com
3
get
image
https://www.delltechnologies.com/content/dell-assetshare/login.htm?resource=%2Fcontent%2Fdam%2Fss2%2Fproduct-images%2Fpage%2Fuber%2FDTW_24_Dellcom_Banners_EventsPage_Desktop_1920x600.jpg%3Fnull&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown
+4
www.dell.com
3
get
image
https://e13665.dscx.akamaiedge.net/
aliasURL=https://www.delltechnologies.com/content/dell-assetshare/login.html?resource=%2Fcontent%2Fdam%2Fss2%2Fproduct-images%2Fpage%2Fuber%2FDTW_24_Dellcom_Banners_EventsPage_Desktop_1920x600.jpg%3Fnull&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown
+4
www.dell.com
3
get
image
https://www.delltechnologies.com/content/dell-assetshare/login.html?resource=%2Fcontent%2Fdam%2Fss2%2Fproduct-images%2Fpage%2Fuber%2FDTW_24_Dellcom_Banners_EventsPage_Desktop_1920x600.jpg%3Fnull&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown
+4
www.dell.com
1
get
xhr
https://www.dell.com/etc/designs/uwaem/assets/json/dt-fonts.json
+4
www.dell.com
1
get
image
https://www.dell.com/content/dam/ss2/product-images/page/uber/DTW_24_Dellcom_Banners_EventsPage_Desktop_1920x600.jpg?null
+4
* * 3p-script block
--
www.dell.com
3
get
script
https://e13665.dscx.akamaiedge.net/
aliasURL=https://nexus.dell.com/dell/marketing/Bootstrap.js
+4
www.dell.com
1
get
script
https://nexus.dell.com/dell/marketing/Bootstrap.js
+4
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/assets/js/delltech/v5/uw/_web-workers/get-content-worker.js
+4
www.dell.com
1
get
script
https://www.dell.com/cdn/assets/csb/unified-comm/bundles/1.0.0.8154/js/unified-dt-min.js
+4
www.dell.com
1
get
xhr
https://www.dell.com/content/dam/web-resources/project-specific/events-calendars/events-calendar-2021-featured-events/featured-cz.json
+4
www.dell.com
1
get
xhr
https://www.dell.com/dt/events/info?cache=cz
+4
www.dell.com
1
get
xhr
https://www.dell.com/des/api/calendar-service/v1/getCalendarEvents
+4
www.dell.com
1
get
script
https://www.dell.com/content/dam/web-resources/project-specific/events-calendars/events-calendar-2021/events-calendar-74849fb4386ca7b412e8.js
+4
www.dell.com
1
get
xhr
https://www.dell.com/cs-cz/dt/configuration-page/forms-validation.html
+4
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/assets/js/uw/_libs/jquery/jquery-validate-methods.min.js
+4
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/assets/js/uw/_libs/jquery/jquery-validate.min.js
+4
www.dell.com
3
get
image
https://na174-ia5.ia5.r.salesforce.com/
aliasURL=https://dcsf.my.salesforce-sites.com/liveAgentSetupFlow/resource/Dell_Chat_Logo_SVG
+4
www.dell.com
3
get
image
https://dcsf.my.salesforce-sites.com/liveAgentSetupFlow/resource/Dell_Chat_Logo_SVG
+4
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/assets/js/uw/hve.min.js
+4
* * 3p-script block
--
www.dell.com
3
get
script
https://e13665.dscx.akamaiedge.net/
aliasURL=https://nexus.dell.com/dell/emc/Bootstrap.js
+4
www.dell.com
1
get
script
https://nexus.dell.com/dell/emc/Bootstrap.js
+4
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/widgets/uw/right-rail.min.js
+4
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/widgets/uw/livechat.min.js
+4
www.dell.com
1
get
xhr
https://www.dell.com/etc/designs/uwaem/assets/other/contact-popup-form/globalnav-contact-form-lookup-table.csv
+3
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/widgets/uw/contactus-popup.min.js
+3
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/widgets/uw/contactus-form.min.js
+3
www.dell.com
1
get
xhr
https://www.dell.com/content/dam/web-resources/project-specific/virtual-events/dictionary.json
+3
www.dell.com
1
get
xhr
https://www.dell.com/csbapi/unified-communication/contact/dt/cz/cs/corp/dellemc
+3
www.dell.com
1
get
script
https://www.dell.com/content/dam/web-resources/project-specific/events-calendars/events-calendar-2021/config-e72d0d18e2bcb2936961.js
+3
www.dell.com
3
get
image
https://dellicm-dell-na174.secure.force.com/liveAgentSetupFlow/resource/Dell_Chat_Logo_SVG
+3
www.dell.com
1
get
xhr
https://www.dell.com/delltechsp/api/profile?_=1728226956881
+3
/akam/13/*
--
www.dell.com
1
get
script
https://www.dell.com/akam/13/10971ce6
+3
* * 3p-script block
--
www.dell.com
3
get
script
https://afcs.dellcdn.com/tnt/adobebundle/delltech/adobebundle.min.js
+3
* * 3p-script block
--
www.dell.com
3
get
script
https://afcs.dellcdn.com/boomerang/latest/boomerang-nonspaWithClicks.min.js
+3
www.dell.com
1
get
script
https://www.dell.com/LbRzyoC_f/Nut/fGoSIA/Shic7G/W19HNgFaBQ/HHcjE/GMpPhgp
+3
www.dell.com
1
get
script
https://www.dell.com/cdn/assets/csb/unified-comm/bundles/1.0.0.7751/js/unified-communication-dt-init-min.js
+3
www.dell.com
1
get
script
https://www.dell.com/content/dam/web-resources/project-specific/events-calendars/events-calendar-2021/app-67e708eccdfd4e8d681b.js
+3
www.dell.com
1
get
script
https://www.dell.com/content/dam/web-resources/project-specific/events-calendars/events-calendar-2021/chunk-vendors-9b889c07dfe0501b6d94.js
+3
www.dell.com
1
get
xhr
https://www.dell.com/delltechsp/api/profile
+3
www.dell.com
1
get
script
https://www.dell.com/cdn/assets/csb/unifiedmasthead/bundles/1.0.1.19013/js/mastheadscripts-marketing-v1.min.js
+3
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/delltech/v4/dt.min.75ab7dcfa18495bc06cc2599f61ceacd.js
+3
/akam/13/*
--
www.dell.com
1
get
script
https://www.dell.com/akam/13/10971ce6
+3
* * 3p-script block
--
www.dell.com
3
get
script
https://afcs.dellcdn.com/tnt/adobebundle/delltech/adobebundle.min.js
+3
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/analytics/boomerang.min.5aa772a217a8cb3a32e0fe7187af7899.js
+3
* * 3p-script block
--
www.dell.com
3
get
script
https://afcs.dellcdn.com/boomerang/latest/boomerang-nonspaWithClicks.min.js
+3
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/delltech/v4/dt-core.min.d6778f69719a0379f3cab17a0cc54430.js
+3
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/clientlibs/js/delltech/v4/dt-getContent.min.9336fe5b05f99e7e9f18509af2b89031.js
+3
##+js(set-constant, useSeznamAds, false)
www.dell.com
get
scriptlet
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
+3
www.dell.com
1
get
script
https://www.dell.com/content/dam/delltechnologies/assets/ghf/js/release.js
+3
[www.dell.com][set-constant ⁝ useSeznamAds ⁝ false] Trap installed
info
scriptlet
+3
no-remote-fonts: * true
--
www.dell.com
1
get
doc
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
+3
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
+3
no-remote-fonts: * true
--
www.dell.com
1
get
inline-font
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
+3
www.dell.com
1
get
doc
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
+3
https://www.dell.com/cs-cz/dt/events/index.htm#scroll=off&format=in-person
+0
www.dell.com
1
get
xhr
https://www.dell.com/etc/designs/uwaem/assets/json/dt-fonts.json
+0
www.dell.com
1
get
script
https://www.dell.com/etc/designs/uwaem/assets/js/delltech/v5/uw/_web-workers/get-content-worker.js
`

I can do it if you share your custom filters in a text file which I can copy/paste to "My filters" and see if I can reproduce on my side. If I can, then I will do the bisect.

Hmm, if it's not clear from the logger, OK. But I'll share the filters only privately if I may. Where should I send it?

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

Where should I send it?

You can send it to rhill at raymondhill dot net

Once you paste all your filters in a text file, save the text file then delete the whole content of "My filters", copy paste again the content of the text file back to "My filters", and see if the issue still exist. If not, then there is no point to send me the file since this is essentially what I need to do on my side to first reproduce the issue.

@garry-ut99
Copy link

garry-ut99 commented Oct 6, 2024

garry-ut99: This means that the both files contained all the filters, just that when importing

bimg21: Actually, no. Even when opening the .txt file in text editor, it only had 69 rows.

This is strange, maybe the rest are empty zero-length spaces or other invisible characters which might be invisible by default in some text editors, unless option is set to see them by default.

bimg21: I Hmm, you mean comment out 1300 lines manually one by one, then 650 and so on? That'd be awful lot of work.

Nope, you seem to have missed an easy way to select many filters (lines) at once, which is already mentioned in the uBlock documentation: you can just select half of the filters and press Tab key like already explained:

https://github.com/gorhill/uBlock/wiki/Dashboard:-My-filters: (uBO-specific) Toggle prepending the current line or the lines in the current selection with ! (to quickly toggle the commenting out of filters).

@bimg21
Copy link
Author

bimg21 commented Oct 6, 2024

delete the whole content of "My filters", copy paste again the content of the text file back to "My filters", and see if the issue still exist

It does persist.

you can just select half of the filters and press Tab key

A-HA!! That streamlined the process well enough.
So I used the bisection method using this trick and I DID find the culprit!
*##:xpath(//.[contains(text(),'ONLINE')] and ancestor::span[contains(@class, 'place')])
I have no idea what I created this filter for but it definitely shouldn't have been allowed for all websites.

Looks like it was generic enough to affect a great number of websites. What still bugs me is why it affected them intermittently.

Thanks a lot, garry-ut99 (and gorhill too). Sending a virtual hug to both of you 🤗

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

*##:xpath(//.[contains(text(),'ONLINE')] and ancestor::span[contains(@class, 'place')])

That filter is rejected on my side, and dell.com##li.dec-card--clickable.dec-card:has-text(ebinar) still works fine:

image

Since the filter is rejected at compile time, it can't possibly be causing your issue.

@garry-ut99
Copy link

garry-ut99 commented Oct 6, 2024

On Chromium yes - it's rejected, but in Firefox (which OP uses) it is not rejected:
ss_21

Another thig is that even after changing span to x, class to id and place to y the breakage still occurs:
*##:xpath(//.[contains(text(),'ONLINE')] and ancestor::x[contains(@id, 'y')])

Doesn't occur with *##:xpath(//.[contains(text(),'ONLINE')])

http://xpather.com/ throws an error:

Error: Required cardinality of first argument of contains() is one or zero
ss_19

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

Firefox returns a valid XPathExpression object, and surely it should have thrown. I am guessing the original intent was to fulfill two conditions, in which case this works:

*##:xpath("//.[contains(text(),'ONLINE')][ancestor::span[contains(@class, 'place')]]")

This also works:

*##:xpath("//.[contains(text(),'ONLINE') and ancestor::span[contains(@class, 'place')]]")

Problem with the faulty filter is that and doesn't appear inside [...].

In any case, that Firefox does not report an error prevents uBO from detecting and discarding the faulty filter.

I get an exception at evaluation time:

var expr = document.createExpression("//.[contains(text(),'ONLINE')] and ancestor::span[contains(@class, 'place')]", null)
expr.evaluate(document.documentElement, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE)
Uncaught TypeError: XPathExpression.evaluate: Result type mismatch
    <anonymous> debugger eval code:1
debugger eval code:1:6

@bimg21
Copy link
Author

bimg21 commented Oct 6, 2024

That filter is rejected on my side...

On my side in Firefox it was not marked red. And commenting it out solved the issue on dell.com and at least one more website where the issue was occurring (even after repeated refreshes).

http://xpather.com/ throws an error:

So it's not only my poorly constructed filter but I've co-found an actual bug?

I am guessing the original intent was to fulfill two conditions

Not sure, the filter is from July but yes, it was most likely meant to filter stuff out if both conditions are met on a particular website. Modifying the filter to *##:xpath("//.[contains(text(),'ONLINE')][ancestor::span[contains(@class, 'place')]]") and allowing it back works just fine.

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

I think the issue is asking for XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE result, but the expression is designed to return a boolean, XPathResult.BOOLEAN_TYPE. It doesn't throw when using XPathResult.BOOLEAN_TYPE. The expression is meant to return a boolean because the and is outside [...].

I will have to dig to figure the best fix for this.

gorhill added a commit to gorhill/uBlock that referenced this issue Oct 6, 2024
Related issue:
uBlockOrigin/uBlock-issues#3403

To ensure XPath expressions not meant to return a nodeset are
discarded at compile time.
@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

I am going to assume there are no issue in Firefox. The fact that an xpath expression can return a boolean value is supported by the fact that one can ask for a XPathResult.BOOLEAN_TYPE result.

Then the question becomes why does Chromium flag the expression as invalid, more accurately as "syntax error". That I don't know. In any case, in the next dev build uBO will be able to catch as invalid xpath expressions which are valid but not meant to return a nodeset.

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

Note that this works in Chromium (until I publish the fix):

*##:xpath("//*[contains(text(),'ONLINE')] and ancestor::span[contains(@class, 'place')]")

But then it will fail later like in Firefox at evaluation time. The asterisk should be used when you mean to match any element. If you want relative matching to the current node:

*##p:xpath("./*[contains(text(),'ONLINE')] and ancestor::span[contains(@class, 'place')]")

@bimg21
Copy link
Author

bimg21 commented Oct 6, 2024

Is there a difference between *##xyz and ##xyz? I have several filters without the asterisk and uBO is not marking either in red. Just not sure if those apply to all websites as well.

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

*## is required to make generic procedural filters. Generic procedural filters are not advised because of performance concerns and they will error when using ##. Using filters such as *##:xpath(...) is strongly discouraged and may easily lead to performance issues, and procedural cosmetic filters are designed to be dropped by uBO at any given time when it detects undue execution time.

@bimg21
Copy link
Author

bimg21 commented Oct 6, 2024

Using filters such as *##:xpath(...) is strongly discouraged and may easily lead to performance issues

I presume that when website loads uBO only looks up filters that apply to THE site and ALL sites and only then applies/computes them hence the performance penalty.

Oops, I have 128 instances of *## (40 of which are*##:xpath). Lot of the 128 are to catch annoying cookie notices not caught by filter lists but sizeable portion of them is also for a family of websites that are under one company and I want to block entries with certain keywords but the layout is different on each site so I went with this (one example):

*##:xpath(//.[self::li or self::article][descendant::*[contains(.,"PIZZA")] and ancestor::*[contains(.,'stringthatisonallofthecompanywebsites')]])

@gorhill
Copy link
Member

gorhill commented Oct 6, 2024

when website loads uBO only looks up filters that apply to THE site

How would uBO know that a generic filter is not meant to apply to a site without actually applying the filter to the site to find out if there is a hit?

@garry-ut99
Copy link

garry-ut99 commented Oct 7, 2024

bimg21: Is there a difference between *##xyz and ##xyz?

https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#specific-generic

bimg21: I have several filters without the asterisk and uBO is not marking either in red. Just not sure if those apply to all websites as well.

https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters#important

bimg21: Oops, I have 128 instances of *## (40 of which are *##:xpath). Lot of the 128 are to catch annoying cookie notices not caught by filter lists but sizeable portion of them is also for a family of websites that are under one company and I want to block entries with certain keywords but the layout is different on each site so I went with this (one example):

Maybe consider reporting such sites (or at least some of them) to https://github.com/easylist/easylist or https://github.com/uBlockOrigin/uAssets to let devs try to fix them, the whole community will benefit as well, you will benefit too if these sites will be fixed using domains domain1.com,domain2.com## because such filters will be better for performance, than *##.

@krystian3w
Copy link

krystian3w commented Oct 7, 2024

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

However, it should be 111 KiB vs 114 KiB - maybe your system automatically compresses files and the file is even larger than 114 KiB.


As for reporting these 128 sites, it is likely that many applications at the 127 stage check whether they can abandon XPath in favor of network filters, HTML Filtering, or scriptlets -the popularization of React templates without stable attributes like aria-label with English may be the culprit.

@bimg21
Copy link
Author

bimg21 commented Oct 7, 2024

domain1.com,domain2.com##

Nice! It seems to work that way. I found a discussion from few years ago claiming it's not possible and suggesting possible workarounds. Apparently it got implemented. 🥲

@stephenhawk8054
Copy link
Member

Which discussion?

@bimg21
Copy link
Author

bimg21 commented Oct 7, 2024

Here

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Oct 7, 2024

That discussion talked about a total different syntax of combing multiple filters with multiple domains in 1 pre-defined line. It's not related to what you are thinking about.

What you are talking about (domain1.com,domain2.com##) is implemented from the 1st version of uBO, because it's the generic syntax of many blockers.

@gorhill gorhill closed this as completed Oct 8, 2024
@gorhill gorhill added fixed issue has been addressed and removed unable to reproduce cannot reproduce the issue labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

5 participants