Fixes T7558. This might not be 100% perfect but should solve most of the issue.
I briefly looked at things like MutationObserver (some fancy next-gen browser junk) but couldn't immediately get it working.
Other methods for handling this kind of thing involve polling, complicated polyfills, etc. We could give MutationObserver a more serious effort if this is too leaky.