I need write a browser plugin for Chrome where I want to manipulate certain elements. Manipulating the content is not an issue but the page I want to manipulate loads additional content after the page was already done loading.
So my script changes the content but once the page loads the additional content it rebuilds the content and overwrites my changes again.
How can I track those changes or additional loading elements ?
Thanks
I would recommend either using a
setIntervalwhich would allow you to overwrite any changes made after the additional content is loaded. Or aMutationObserverwhich would allow you watch all incoming changes and make updates accordingly.setInterval Example:
MutationObserver Example:
References
setInverval: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval MutationObserver:https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver