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

Some filter rules suddenly stopped working #3050

Closed
9 tasks done
bdr99 opened this issue Dec 30, 2023 · 24 comments
Closed
9 tasks done

Some filter rules suddenly stopped working #3050

bdr99 opened this issue Dec 30, 2023 · 24 comments
Labels
invalid not a uBlock issue

Comments

@bdr99
Copy link

bdr99 commented Dec 30, 2023

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 an issue with YouTube, Facebook or Twitch.
  • 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

I noticed that recently, certain filter rules are no longer being applied, for seemingly no reason.

For example, EasyList contains this rule which is supposed to remove ads on Reddit:

reddit.com,reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion##.promotedlink:not([style^="height: 1px;"])

But when I navigate to a Reddit page that contains ads, such as https://old.reddit.com/r/uBlockOrigin/, I still see the "promoted" posts. If I check the logger, the rule is shown and highlighted in yellow, which I believe means it should have been applied.

image

I have tried the following:

Attempted Solution Outcome
Disabled all add-ons except uBO No change.
Reset uBO using the "Reset to default settings" button No change.
Used a new unmodified browser profile This does fix the issue, but I'm trying to fix it on my existing browser profile.
Added the above filter rule to "My filters" No change.
Unchecked "Parse and enforce cosmetic filters" No change.
Added the rule to "My filters" AND unchecked "Parse and enforce cosmetic filters" This works and the rule is applied correctly.
Held shift, clicked "Purge all caches", then updated filter lists. No change.
Uninstalled and reinstalled uBO. No change.

A specific URL where the issue occurs.

https://old.reddit.com/r/uBlockOrigin/

Steps to Reproduce

  1. Install uBO with default settings and filter lists.
  2. Navigate to https://old.reddit.com/r/uBlockOrigin/.

Expected behavior

Promoted posts should not be visible.

Actual behavior

Promoted posts are visible.

uBO version

1.54.0

Browser name and version

Firefox 121.0

Operating System and version

Windows 11

@gwarser
Copy link

gwarser commented Dec 30, 2023

Please share your troubleshooting information. Go to Reddit, click uBO icon on toolbar, the "chat" button, "Troubleshooting Information" at the bottom, select all and copy here.

@bdr99
Copy link
Author

bdr99 commented Dec 30, 2023

@gwarser Thanks for the reply, here is my troubleshooting info:

uBlock Origin: 1.54.0
Firefox: 121
filterset (summary):
 network: 104575
 cosmetic: 44290
 scriptlet: 18655
 html: 1978
listset (total-discarded, last-updated):
 default:
  user-filters: 0-0, never
  ublock-filters: 37241-151, 12h.10m
  ublock-badware: 7569-11, 12h.10m
  ublock-privacy: 948-4, 12h.10m
  ublock-unbreak: 2222-1, 12h.10m
  ublock-quick-fixes: 152-0, 12h.10m
  easylist: 76499-670, 12h.10m
  easyprivacy: 33170-811, 12h.10m
  urlhaus-1: 9710-0, 12h.10m
  plowe-0: 3784-1, 12h.10m
filterset (user): [empty]
userSettings: [none]
hiddenSettings: [none]
supportStats:
 allReadyAfter: 318 ms
 maxAssetCacheWait: 131 ms
popupPanel:
 blocked: 12
 network:
  reddit.com: 9
  ad-delivery.net: 1
  redditmedia.com: 1
  redditstatic.com: 1
 extended:
  ##a.outbound[data-outbound-url]:remove-attr(data-outbound-url)
  ##+js(abort-on-property-write, STICKY_CANARY)

@gwarser
Copy link

gwarser commented Dec 30, 2023

Can you reapeat the logging and click the .promotedlink... filter to see details? Does it tell the filter is from EasyList?

Try if clicking "Purge all caches" with Shift pressed and the updating filter lists improves something.

@bdr99
Copy link
Author

bdr99 commented Dec 30, 2023

@gwarser

This is what I see if I click on the filter in the logger.

image

I tried holding shift and clicking "Purge all caches" and then updating the filter lists, but this didn't help unfortunately. I also tried uninstalling uBO entirely and installing it again, but this didn't help either.

@gwarser
Copy link

gwarser commented Dec 30, 2023

If you switch the logger to DOM inspector (the </> button in top right) did you see the .promotedlink... filter blocking something?

I think it's Reddit doing some A/B testing.


Crosslinking https://www.reddit.com/r/uBlockOrigin/comments/18um5lm/promoted_ads_have_started_appearing_on_reddit_for/

@bdr99
Copy link
Author

bdr99 commented Dec 30, 2023

If you switch the logger to DOM inspector (the </> button in top right) did you see the .promotedlink... filter blocking something?

If I click on the DOM inspector button, I actually just get a blank screen.

image

I think it's Reddit doing some A/B testing.

But the strange part is that (as mentioned in the issue description) if I add that same exact rule to "my filters", it works (as long as I also uncheck "Parse and enforce cosmetic filters").

@u-RraaLL
Copy link
Contributor

Install dev build and test: https:/gorhill/uBlock/releases/tag/1.54.1rc1

To install click the signed firefox file. Proceed with accepting, then right-click uBO icon > Manage extension > Update now.

@bdr99
Copy link
Author

bdr99 commented Dec 30, 2023

@u-RraaLL No change, I still get the same issue with 1.54.1rc1.

@bdr99
Copy link
Author

bdr99 commented Dec 30, 2023

Also, I checked the DOM, and I can see that the reddit ad div still has the promotedlink CSS class. So it definitely seems like it should still match that rule.

image

@gorhill
Copy link
Member

gorhill commented Dec 30, 2023

Maybe one invalid cosmetic filter being injected is breaking all others. Would need to find which cosmetic filter from which list.

@gorhill
Copy link
Member

gorhill commented Dec 30, 2023

To help narrow the problematic cosmetic filter, first, try:

@@||reddit.com^$ghide

This will tell us whether the problematic filter is generic or specific.


Also, looking at the page logger dev tools console when enabling dom inspector might show an selector error being reported.

@bdr99
Copy link
Author

bdr99 commented Dec 30, 2023

Maybe one invalid cosmetic filter being injected is breaking all others. Would need to find which cosmetic filter from which list.

When I test with a clean Firefox profile, I don't see this issue. Wouldn't this indicate that it isn't caused by a filter rule?

To help narrow the problematic cosmetic filter, first, try:

@@||reddit.com^$ghide

This will tell us whether the problematic filter is generic or specific.

I added this rule to "My rules" but there was no change, I still see the ad.

Also, looking at the page logger dev tools console when enabling dom inspector might show an selector error being reported.

It doesn't look like there is any output in the logger dev tools console when enabling the DOM inspector.

image

@gorhill
Copy link
Member

gorhill commented Dec 30, 2023

Used a new unmodified browser profile
his does fix the issue, but I'm trying to fix it on my existing browser profile.

Did you set layout.css.has-selector.enabled to false in about:config? I can reproduce all your symptoms when setting it to false. It defaults to true as of Firefox 121.

@garry-ut99
Copy link

garry-ut99 commented Dec 30, 2023

bdr99 : #3050 (comment) : But the strange part is that (as mentioned in the issue description) if I add that same exact rule to "my filters", it works

Nothing strange, it's by design, unchecking this option disables all cosmetic filters in all filter lists, except "My Filters pane", that's why your filter still works, like already mentioned in :


bdr99 : #3050 (comment) : (as long as I also uncheck "Parse and enforce cosmetic filters").

Why it works only after disabling cosmetic filters in all lists, is another story, maybe because like gorhill already said : maybe one of lists/filter breaking the other.

gorhill : #3050 (comment) : Maybe one invalid cosmetic filter being injected is breaking all others. Would need to find which cosmetic filter from which list.

Similiar to the old story (but this time in Firefox) :

@gorhill
Copy link
Member

gorhill commented Dec 30, 2023

If reddit.com##.promotedlink:not([style^="height: 1px;"]) works in "My filters", then add reddit.com##.size-compact.Post:has([class*="promoted"]) and see if the issue comes back.

@bdr99
Copy link
Author

bdr99 commented Dec 30, 2023

Did you set layout.css.has-selector.enabled to false in about:config? I can reproduce all your symptoms when setting it to false. It defaults to true as of Firefox 121.

Yes, I actually did previously set it to false in my user.js to work around a rendering bug I was experiencing in Firefox 117. I just tried setting it to true and it fixes my issue. So the issue only occurs with layout.css.has-selector.enabled set to false. This also made the DOM inspector start working again.

I also noticed that if I disable the "uBlock filters – Ads" list, it fixes the issue as well, even with layout.css.has-selector.enabled still set to false. So maybe the rule from EasyList is conflicting with a rule from this list.

If reddit.com##.promotedlink:not([style^="height: 1px;"]) works in "My filters", then add reddit.com##.size-compact.Post:has([class*="promoted"]) and see if the issue comes back.

Yes, it was exactly like you predicted. After unchecking "Parse and enforce cosmetic filters", adding your first rule fixed the issue, and adding your second rule made the issue come back.

@garry-ut99
Copy link

Same here, with one exception :

bdr99 : and adding your second rule made the issue come back.

On Firefox 115.6.0 ESR adding the second rule doesn't make the issue come back for me.

@gorhill
Copy link
Member

gorhill commented Dec 30, 2023

Because Firefox 115 does not report supporting native :has(), so uBO's procedural code path is taken.

@gorhill gorhill added the invalid not a uBlock issue label Dec 30, 2023
@gorhill gorhill closed this as completed Dec 30, 2023
@garry-ut99
Copy link

garry-ut99 commented Dec 31, 2023

I have a question, I don't understand your answer, since we're talking about a case with layout.css.has-selector.enabled set to false in both FF 115 and FF 121, so both of them report as not supporting native :has() (if ( CSS.supports('selector(a:has(b))') )). (Unless FF 121 still reports as supporting :has() despite the flag set to false, but I'm unable to verify this at the moment, due to lack of access to PC with FF 121)

garry-ut99 : On Firefox 115.6.0 ESR adding the second rule doesn't make the issue come back for me.

Not anymore, today adding the second rule does make the issue come back, I'm not sure whether because reddit serves things randomly.

@gwarser
Copy link

gwarser commented Dec 31, 2023

@garry-ut99 not sure if this answers your question, but the CSS.supports is recent gorhill/uBlock@38bde79 previously it was simple version check gorhill/uBlock@c5724c1cce

@gorhill
Copy link
Member

gorhill commented Dec 31, 2023

layout.css.has-selector.enabled set to false in both FF 115 and FF 121

It's not a given that layout.css.has-selector.enabled to false will cause CSS.supports('a:has(b)') to return false now that :has() is officially supported. Well, not only not a given, but clearly it doesn't take into account that about:config flag anymore given the issue here.

@garry-ut99
Copy link

garry-ut99 commented Dec 31, 2023

gwarser : not sure if this answers your question (...)

It doesn't answer my question, because I use the newest uBO dev (1.54.1rc1).

gorhill : It's not a given that (...)

Nor it's given, that setting it to false is supposed to not work anymore, if a flag doesn't work anymore, then should be removed, or be clear information somewhere, otherwise it misleads users.

@gorhill
Copy link
Member

gorhill commented Dec 31, 2023

then should be removed

No point arguing that here, just open an issue at bugzilla.

@garry-ut99
Copy link

Not me who started "it's not a given" odd arguing in this place, I only replied in the same place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid not a uBlock issue
Projects
None yet
Development

No branches or pull requests

5 participants