brandon1024 / find

A find-in-page extension for Chrome and Firefox that supports regular expressions.
https://chrome.google.com/webstore/detail/find%2B-regex-find-in-page/fddffkdncgkkdjobemgbpojjeffmmofb
GNU General Public License v3.0
414 stars 54 forks source link

Errors while trying to search #315

Open micouy opened 4 years ago

micouy commented 4 years ago

Issue Description

I get errors in console after just trying out the extension. My browser is Brave 1.3.118. I have just installed the extension.

Errors:

Error in event handler: TypeError: Cannot read property 'childNodes' of null
    at Object.self.highlightAll (chrome-extension://<extension-id>/content/highlighter.js:69:31)
    at chrome-extension://<extension-id>/content/content.js:48:42
Error in event handler: TypeError: Cannot read property 'parentElement' of null
    at Object.self.restoreWebPage (chrome-extension://<extension-id>/content/parser.js:152:20)
    at chrome-extension://<extension-id>/content/content.js:38:37
Error in event handler: TypeError: Cannot read property 'nodeUUID' of undefined
    at Object.self.highlightAll (chrome-extension://<extension-id>/content/highlighter.js:162:63)
    at chrome-extension://<extension-id>/content/content.js:48:42

Steps to Reproduce

brandon1024 commented 4 years ago

Interesting. The extension really doesn't like this page for some reason. I'll dig into this some more when I have some free time.

brandon1024 commented 4 years ago

@micouy I looked into this a bit further today. I originally thought that this was because the Rust docs pages were dynamic, but that doesn't seem to be the case. The Rust documentation seems to use a templating engine that is pretty heavy on the HTML markup. Specifically, it wraps bits of text in elements for highlighting and indentation. The one you included in your ticket was particularly bad given how large the source file was; it was even difficult for me to show the HTML in the dev tools.

image

My guess is that the extension is churning on the page and becomes unresponsive for a while. If you let the extension run on the page, the expression (sometimes) gets highlighted but it takes quite a while.

I have addressed the performance of the extension in a number of other issues, and I've optimized the extension as much as I reasonably can. At this juncture, I've decided that the extension simply won't support enormous DOMs or a large amount of data. It's a bummer, but my hands are tied.

In light of this though, I'm going to make a few changes to help report to the user when dynamic pages or strange errors are detected. These changes should come out soon.

Thanks for your patience!