0

I need to create some sort of listener and fire whenever the page is being injected with external code (ember) when a new <div> with a specific class is added, I need to perform plug-in logic. Is it actually possible to do that from within a Add-on in Firefox/Chrome?

S. W. G.
  • 433
  • 1
  • 6
  • 19
  • 2
    You could use the mutation observer (https://javascript.info/mutation-observer) in your content script (which is injected in the page). – relentless Mar 14 '22 at 14:42
  • 1
    @ArslanAli Thanks this helped. I'm now stuck on cycling the nodes, I don't know but I cannot filter the relevant tag, here is my other question: https://stackoverflow.com/questions/71473992/how-to-target-specific-tag-in-mutation-observer – S. W. G. Mar 14 '22 at 22:00
  • Glad it helped! I will try to look into your other question – relentless Mar 15 '22 at 12:15

0 Answers0