M4 API MutationObservers can be used to observe mutations to the tree of nodes.
It is designed as a replacement for Mutation Events defined in the DOM3 Events specification.
All you get with it is:
1234
varobserver=newMutationObserver(callback);// Get the changes.observer.observe(target,options);// Observer the desired node with options.observer.disconnect();// Stop observing.observer.takeRecords();// Empty the record queue and returns what was in there.
List of options:
Check out a sample DEMO I made for fun, which load random images from different sources ;)