diff --git a/content_script.js b/content_script.js index cc3c401..237479c 100644 --- a/content_script.js +++ b/content_script.js @@ -48,4 +48,16 @@ function handleText(textNode) textNode.nodeValue = v; } +MutationObserver = window.MutationObserver || window.WebKitMutationObserver; +var observer = new MutationObserver(function(mutations, observer) { + loadReplace(); +}); + +// define what element should be observed by the observer +// and what types of mutations trigger the callback +observer.observe(document, { + subtree: true, + childList: true + //... +}); \ No newline at end of file