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.