Ublock: CodeMirror problem

Created on 2 Mar 2018  路  9Comments  路  Source: gorhill/uBlock

Describe the issue

The browser search function does not work properly in some filter lists.

Steps for anyone to reproduce the issue

  • Install uBlock 1.15.11b6 besides the stable version
  • Open the uBlock-filter list in the stable version and search for "Fingerprint2"
    buggg
    I get 85 hits.
  • Open the uBlock-filter list in the dev version and search for "Fingerprint2"
    bu
    I get zero hits.

Your settings

  • OS/version: Windows 10
  • Browser/version: Chrome 64

Most helpful comment

Thanks, so if you have 85 hits you can use Ctrl-G and Shift-Ctrl-G to go through them all, but this is not ideal for the average user in my opinion.

All 9 comments

Make sure to focus the text area before pressing Ctrl+F so CodeMirror's search bar appears instead of browser one.
CodeMirror will only render lines that are visible because otherwise it kills performance.
image
Personally I still like Ace better

Thanks, so if you have 85 hits you can use Ctrl-G and Shift-Ctrl-G to go through them all, but this is not ideal for the average user in my opinion.

It'll be less ideal if EasyList takes 9 seconds to render.

EasyList renders basically instantly on my end.

In the stable version?

Yeah, I was about to edit my comment, I misunderstood your meaning.

I will see what I can do to improve the search widget -- the default one from the library is rather bare.

Just wanted to mention this in case anyone runs into this problem:

If you're running macOS, Firefox 58 and and have privacy.resistFingerprinting set to true, Code Mirror's search widget won't appear even if you focus on the text area.

I assume it's due to the OS getting spoofed and the usage of cmd keys instead of ctrl (same problem that was occurring with GitHub's text editor, Google Docs and others). Firefox 59 no longer spoofs the operating system, and the search widget works fine there with RFP on.

https://bugzilla.mozilla.org/show_bug.cgi?id=1404608
https://bugzilla.mozilla.org/show_bug.cgi?id=1405810

I added a sticky search widget at the top of codemirror editor, this way whichever search feature is used should become obvious. The browser's own find-in-page feature is not suitable for codemirror editors.

Advantages of the codemirror's own search widget:

  • supports regex (use /.../)
  • scrollbar annotations work on both chromium and firefox.

this is a customized version of the stock codemirror search widget, to deal properly with ctrl-f and related shortcuts, and to modify the behavior to better suit the usage in uBO.

Was this page helpful?
0 / 5 - 0 ratings