From 4634c26844bffa653d78ccd7f7d00e60c9dcaf89 Mon Sep 17 00:00:00 2001 From: Amjad Mash'al Date: Thu, 26 Mar 2015 01:02:34 +0200 Subject: [PATCH] Fixed changing names on AJAX pages --- content_script.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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