Created
August 24, 2015 15:21
-
-
Save alessioalex/5bc89f176a762b6fc64a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var observer = new MutationObserver(function(mutations) { | |
| //console.log('OBSERVED', mutations); | |
| var observation = parseInt(Math.random() * 100); | |
| console.group('Observation ' + observation); | |
| mutations.forEach(function(mutation) { | |
| console.log('%s: %s', mutation.target.nodeName, mutation.type, mutation); | |
| }); | |
| console.groupEnd(); | |
| }); | |
| var config = {childList: true, attributes: true, characterData: true, subtree: true, attributeOldValue: true, characterDataOldValue: true}; | |
| observer.observe($0, config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment