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

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

Closed
9 tasks done
garry-ut99 opened this issue Feb 26, 2024 · 1 comment
Labels
bug Something isn't working fixed issue has been addressed

Comments

@garry-ut99
Copy link

garry-ut99 commented Feb 26, 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

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

@gorhill
Copy link
Member

gorhill commented Feb 26, 2024

There is a data: URI on that page, which is causing issue with the filter-derived regex, I can reproduce at regex101.

@gwarser gwarser added the bug Something isn't working label Feb 26, 2024
gorhill added a commit to gorhill/uBlock that referenced this issue Feb 26, 2024
@gwarser gwarser added the fixed issue has been addressed label Feb 27, 2024
@gwarser gwarser closed this as completed Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

3 participants