0

I have a Chrome extension that highlights keywords (using a simple markup lookup) based on the webpage source code. However, it currently only runs on page load and fails to highlight keywords in subsequent DOM changes (esp. modal windows). I'd like the extension to automatically highlight keywords that appear in those subsequent DOM changes. Is there a quick fix for this? I was thinking somehow using MutationObserver to watch for changes but (being an amateur) I'm not sure how to incorporate it. I appreciate there might be a better (and quicker?) way to do this. Also any idea how long it would take someone to provide a solution (assuming I can't figure it out) Grateful for any help.

  • MutationObserver is the correct method and most likely the only one. Without [MCVE](/help/mcve) e.g. your code and your attempts to incorporate the observer, the question is unanswerable as it's just a duplicate. – wOxxOm Sep 28 '20 at 14:47
  • Thanks for this, wOxxOm. I'll see if I can add some more specifics. – AmateurHour Sep 28 '20 at 14:49

0 Answers0