A dirty workaround is to hook prototype methods like Element like this:
window.attachEvent('onload', function() { invokeNodeInserted(document); (function(replace) { Element.prototype.appendChild = function(newElement, element) { invokeNodeInserted(newElement); return replace.apply(this, [newElement, element]); }; })(Element.prototype.appendChild); (function(replace) { Element.prototype.insertBefore = function(newElement, element) { invokeNodeInserted(newElement); return replace.apply(this, [newElement, element]); }; })(Element.prototype.insertBefore); (function(replace) { Element.prototype.replaceChild = function(newElement, element) { invokeNodeInserted(newElement); return replace.apply(this, [newElement, element]); }; })(Element.prototype.replaceChild); });
Tires May 20 '14 at 11:31 2014-05-20 11:31
source share