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

Adjust to Dynamic DOMA #28

Open
ChrisERo opened this issue Oct 17, 2022 · 2 comments
Open

Adjust to Dynamic DOMA #28

ChrisERo opened this issue Oct 17, 2022 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ChrisERo
Copy link
Owner

Right now, extension works by waiting for some time (e.g. 800 milliseconds) and the highlighting text in website. This works well for static websites whose content is finalized by that time, but not so well for dynamic pages (those whose DOM may change over time, or at least after the expected length). This would result in a lot of text getting placed in missing section unnecessarily.

To resolve this issue. I propose adding some listener to see if the DOM changes (for reasons other than highlighting) and if so, perform a search (at least on the changed DOM nodes) for text in missing and highlight if found.

Not sure if this is a real problem the at needs fixing.

@ChrisERo ChrisERo added good first issue Good for newcomers bug Something isn't working enhancement New feature or request and removed good first issue Good for newcomers labels Oct 17, 2022
@ChrisERo
Copy link
Owner Author

ChrisERo commented Nov 19, 2022

@ChrisERo
Copy link
Owner Author

Possible idea:

  1. Set up a permanent MutationObserver and observe body node (Element)
  2. If no missing words, just return
  3. For every update, look though list of added nodes for missingWords, highlighting when found
  4. May need to filter based on modification type and avoid new nodes that are highlight nodes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant