Skip to content

Pasting *##... filter, breaks Element Picker and causes glitches, freezes, errors, warnings and creates strange invalid filter #3142

Description

@garry-ut99

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

Element Picker glitches / freezes for several seconds when pasting https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#specific-generic *##... filter (for example *##[src^="data:"] or even *123 can reproduce it) :

Most visible on Firefox, similiar happens also on Opera but 2x faster (but still long enough to be noticeable)
Firefox : ANIMATION + SCREENSHOOT + PROFILER

CONSOLE
InternalError: too much recursion epicker.js:688:30
    test self-hosted:3574
    fromNetworkFilter moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:688
    queryAll moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:793
    onDialogMessage moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:1174
    onmessage moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:1313
    (asynchroniczny: EventHandlerNonNull)
    bootstrap moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:1312
    (asynchroniczny: EventListener.handleEvent)
    bootstrap moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:1308
    bootstrap moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:1304
    InterpretGeneratorResume self-hosted:1455
    AsyncFunctionNext self-hosted:852
    (asynchroniczny: async)
    <anonimowa> moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:1329
    <anonimowa> moz-extension://xxxxxxxx-yyyy-zzzz-xxxx-yyyyyyyyyyyy/js/scriptlets/epicker.js:1336
    inject resource://gre/modules/ExtensionContent.sys.mjs:581
    AsyncFunctionNext self-hosted:852

Also if wait and when glitch is gone, click Create button and visit My Filters and notice a strange filter created with another error throwed : SCREENSHOOT


I've discovered it when investigating the other issue :
https://github.com/uBlockOrigin/uAssets/issues/22673
https://github.com/uBlockOrigin/uBlock-issues/issues/3141

The workaround is to paste ##... instead of *##... into Element Picker since visual effect they produce is the same, and then after pressing Create, edit "My Filters" and prepend the filter by *, a little cumersome, but on the other side such filters are not created very often, only occasionally, I'm not sure whether Create button should be active when put anything before ## in Picker.

Given the issue can be reproduced even with *123 I'm not sure whether it's related to https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#specific-generic and the way they are injected or is just a random coincidence.

A specific URL where the issue occurs.

https://github.com/404

Steps to Reproduce

  1. visit the page
  2. open Element Picker
  3. paste a https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#specific-generic filter
    (for example *##[src^="data:"] or even a *123 can reproduce as well)
  4. notice glitch/freeze/errors like in Description
  5. wait and when glitch is gone, click Create button
  6. visit My Filters and notice a strange filter created with an error throwed :
    12

Expected behavior

No glitches / freezes / unresponsive warnings / console errors.

Actual behavior

Glitches / freezes / unresponsive warnings / console errors.

uBO version

1.56.1b0

Browser name and version

Firefox 115.8.0esr / Opera 95

Operating System and version

Win 7 SP1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedissue has been addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions