0

So I'm creating a Chrome extension that injects HTML onto the YouTube page. The script works fine when it first loads but if I were to scroll it down it just disappears.

I have tried monitoring for DOM changes using MutationsObserver. I have tried How to wait until an element exists? I have tried Make function wait until element exists I have tried How to detect page navigation on YouTube and modify its appearance seamlessly?

None of them will PERSIST the html element injected on the page. Let me know if more details is needed.

  • what kind of HTML did you inject? – Raptor Sep 18 '20 at 03:51
  • Youtube overwrites the container where you insert your HTML so there's nothing you can do except re-adding it, [example](https://stackoverflow.com/a/63879868), or finding a different place in DOM that's not reset like maybe right under document.body. – wOxxOm Sep 18 '20 at 04:16

0 Answers0