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

The logger removes whitespace in selector #2730

Closed
8 tasks done
Yuki2718 opened this issue Jul 11, 2023 · 9 comments
Closed
8 tasks done

The logger removes whitespace in selector #2730

Yuki2718 opened this issue Jul 11, 2023 · 9 comments
Labels
fixed issue has been addressed

Comments

@Yuki2718
Copy link

Yuki2718 commented Jul 11, 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 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

The logger removes whitespece of ##.a, .b, .c, .d, .e, .f, .g and displays as ##.a,.b,.c,.d,.e,.f,.g, so if I copied the rule from the logger, no match in actual filters. IMO the logger should display filters as are.

logger

A specific URL where the issue occurs.

linksfly.me/demo

Steps to Reproduce

Will be obvious if you visit the URL

Expected behavior

The logger preserves the form of actual filters exactly.

Actual behavior

Not

uBO version

1.50.1b16

Browser name and version

Chrome 114.0.5735.199

Operating System and version

Windows 10

@Yuki2718 Yuki2718 changed the title The logger removes whitespace in selecter The logger removes whitespace in selector Jul 11, 2023
@krystian3w
Copy link

krystian3w commented Jul 11, 2023

Normal for 6-12 months.

If you must disable these cosmetic filter (e.g. @gmarcher, and @realodix sick/ill to fix at origin), then the best copy from viewer of problematic list (e.g. Indonesia/Malaysia list where can be compressed many filters by comma) to add fix compatible with ABP and AdGuard (e.g. copied fastly to EasyList "English").

@gorhill
Copy link
Member

gorhill commented Jul 12, 2023

I can create a working exception to crewbase.net##.a, .b, .c, .d, .e, .f, .g with either #@#.a,.b,.c,.d,.e,.f,.g or #@#.a, .b, .c, .d, .e, .f, .g.

I copied the rule from the logger, no match in actual filters

You mean you manually search for the filter in the list?

The reason the cosmetic filter is changed is that it is normalized in order to make sure that duplicates of properly found and discarded by uBO. Removing normalization would be a step backward.

Related: #620

@krystian3w
Copy link

But now paste these exceptions to ABP and AdGuard parsers, can mark as no match without unlock visibility element.

@Yuki2718
Copy link
Author

You mean you manually search for the filter in the list?

Yes, copied from the log and searched in text file.

The reason the cosmetic filter is changed is that it is normalized in order to make sure that duplicates of properly found and discarded by uBO. Removing normalization would be a step backward.

Okay, then. It's not too serious.

@uBlock-user uBlock-user added the wontfix won't be addressed label Jul 12, 2023
@garry-ut99

This comment was marked as abuse.

@gorhill
Copy link
Member

gorhill commented Jul 13, 2023

By the way: #332

Using CSSTree library made it possible to normalize cosmetic filters, this was not possible back then at the time of this issue.

gorhill added a commit to gorhill/uBlock that referenced this issue Jul 13, 2023
Related issue:
- uBlockOrigin/uBlock-issues#2730

CSS selectors used in cosmetic filtering are normalized in order
to ignore non-functional differences. For instance:

    example.org##body      p
    example.org#@#body p

The first cosmetic filter should be excepted by the second one,
but this was not the case because the fast path use to compile
common CSS selectors was not causing normalization to take
place.

The fix is to ensure that the fast path used to compile most
common CSS selectors is taken only when in presence of already
normalized CSS selectors.
@uBlock-user uBlock-user added fixed issue has been addressed and removed wontfix won't be addressed labels Jul 14, 2023
@garry-ut99

This comment was marked as abuse.

@u-RraaLL u-RraaLL reopened this Jan 9, 2024
@gorhill
Copy link
Member

gorhill commented Jan 9, 2024

There is a tab character in the filter, uBO should mark this as an error:

www.bolec.info##[style="color: #ccc; font-size: 0.60rem;	"]

@garry-ut99

This comment was marked as abuse.

gorhill added a commit to gorhill/uBlock that referenced this issue Jan 9, 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

7 participants