HTML5 includes a concept of \"mutation observers\" to monitor changes to the browser\'s DOM.
Your observer callback will be passed data which looks a lot like DOM tr
I was working on a very similar problem for a Stack Exchange script I'm working on, and I needed to be able to monitor the DOM for changes. The jQuery docs didn't have anything helpful, but I did discover that the DOMNodeInserted event works in Chrome:
document.addEventListener("DOMNodeInserted", function(event){
var element = event.target;
if (element.tagName == 'DIV') {
if (element.id == 'seContainerInbox') {
//alert($('#seContainerInbox').parent().get(0).tagName);
trimStoredItems();
$('#seTabInbox').click();
// var newCount = getNewCount();
// if there are new inbox items, store them for later
storeNewInboxItems();
applyNewStyleToItems();
}
}
});
I'm not 100% sure if this works in Firefox as I haven't got that far yet in the development process. Hope this helps!