hack in an appendChild listener

This commit is contained in:
wgroeneveld 2020-04-13 17:19:02 +02:00
parent a8ddc09cb3
commit cd1767ba1b
1 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ $(function() {
var hijackAppendChildToExecuteAfter = function(afterFn) {
const _appendChild = Node.prototype.appendChild;
const _insertBefore = Node.prototype.insertBefore;
const _replaceChild = Node.prototype.replaceChild;
Node.prototype.appendChild = function(el) {
_appendChild.apply(this, arguments);
@ -77,9 +77,9 @@ $(function() {
afterFn();
}
Node.prototype.insertBefore = function(el) {
_insertBefore.apply(this, arguments);
console.log('inserting before ' + el);
Node.prototype.replaceChild = function(el) {
_replaceChild.apply(this, arguments);
console.log('replacing ' + el);
afterFn();
}
}