Yes, basically you say that every time this item changes, LocalMain should be executed. Since LocalMain also modifies the element, it runs over and over again ...
You can try to remove the EventListener and add it again after (haven't tried it, so I can't tell you if this will work ...)
function LocalMain () { var chatList = document.getElementById('chat_line_list').lastChild.lastElementChild.innerHTML; chatList.removeEventListener("DOMSubtreeModified", LocalMain, false); chatList = chatList.replace('InfoThump', '<span class="newemo-1 emoticon"> (...) chatList = chatList.replace('NotNippy', '<span class="newemo-7 emoticon"></span>'); document.getElementById('chat_line_list').lastChild.lastElementChild.innerHTML = chatList; chatList.addEventListener ("DOMSubtreeModified", LocalMain, false); }
Salem source share