Skip to content

Filter editors unhelpfully insert and eat matching characters #3941

@BenoitHiller

Description

@BenoitHiller

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

The filter editor windows, such as the one on the My filters tab or the options, have the behaviour where they insert a matching parenthesis when you type the opening one, then eat the input of the character later when typing over it.

The current implementation of this behaviour doesn't implement the feature where it checks if the character you type will correctly balance the delimiters before choosing to eat it. This results in an enormous number of situations where it eats characters you don't want it to, and erases the benefit of catching some cases where you accidentally type too many closing parens.

Though in general I really struggle to see how inserting matching characters is a desired behaviour. In the ideal case you get the behaviour that you still have to type the correct delimiters in the correct order, but with the added gotcha that if you typo a character with an opening delimiter it will introduce twice as many incorrect characters.

So please add a toggle for the whole behaviour. There is no harm to having it off by default too, as the people who are somehow used to it will go looking for it, and everyone else won't consciously notice it is gone. They will just find themselves working more effectively.

Worst case please at least check for balancing, but that seems like the more difficult option.

A specific URL where the issue occurs.

moz-extension://a79e32a8-f903-4ae0-8872-5d04ded407be/dashboard.html#1p-filters.html

Steps to Reproduce

  1. Open the settings
  2. Go to My filters
  3. Add a filter like google.com##:has(.advertisement)
  4. Now try changing it to google.com##:has(:not(.advertisement))
  5. Notice how if you typed the closing ) on the inside it ate the ) even though you are still missing one

Expected behavior

It should have inserted the )

Troubleshooting information

uBlock Origin: 1.68.0
Firefox: 147
filterset (summary):
 network: 167051
 cosmetic: 43596
 scriptlet: 28736
 html: 3332
listset (total-discarded, last-updated):
 added:
  ublock-annoyances: 4660-38, 27m Δ
 default:
  user-filters: 8-0, never
  ublock-filters: 44363-72, 27m Δ
  ublock-badware: 10837-31, 27m Δ
  ublock-privacy: 3617-2, 27m Δ
  ublock-unbreak: 2788-1, 27m Δ
  ublock-quick-fixes: 442-14, 27m Δ
  easylist: 92161-150, 27m Δ
  easyprivacy: 55377-29, 27m Δ
  urlhaus-1: 26440-5, 7h.28m
  plowe-0: 3501-1006, 6d.15h.40m
filterset (user): [array of 8 redacted]
trustedset:
 added: [array of 11 redacted]
userSettings:
 advancedUserEnabled: true
hiddenSettings: [none]
supportStats:
 allReadyAfter: 169 ms (selfie)
 maxAssetCacheWait: 59 ms
 cacheBackend: indexedDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixwon't be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions