From 19f7cca3fda69c4c66edfc3d7099cb3dacc3d540 Mon Sep 17 00:00:00 2001 From: KNG <34425597+ECHibiki@users.noreply.github.com> Date: Tue, 6 Mar 2018 00:29:01 -0500 Subject: [PATCH] documentation --- Kita-Yen_4chan.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Kita-Yen_4chan.user.js b/Kita-Yen_4chan.user.js index 56314ce..409df42 100644 --- a/Kita-Yen_4chan.user.js +++ b/Kita-Yen_4chan.user.js @@ -15,9 +15,10 @@ colorCharacters(document.body); addStyle(); new MutationObserver(function(mutations){ + //send a MutationRecord for each mutation mutations.forEach(function(mutation){ - //pass along root nodes - /* (element, index, array) */ + //For this mutation record access the addedNode property and call a function on it. + /* forEach passes on the element, index and array insance */ mutation.addedNodes.forEach(colorCharacters); }); }).observe(document.body, {childList: true, subtree: true}); -- 2.11.4.GIT