I am trying to somehow override the HTMLElement constructor (specifically HTMLDivElement), so that whenever any are created in any way, I can run some user logic.
Obviously this does not work:
HTMLDivElement.prototype.constructor = function() { alert('div created!'); }
Is there any way to remove this? Even if there was a way to get some kind of event / trigger when new elements were created (which were not part of the page’s HTML page), it would be useful.
EDIT: Maybe something we could do with Mozilla's view / disable methods to keep track of the changes?
source share