js原生方法监听DOM结构改变事件
document.addEventListener('DOMNodeInserted',function(){alert(1)},false);
document.addEventListener('DOMAttrModified',function(){alert(1)},false);
document.addEventListener('DOMNodeRemoved',function(){alert(1)},false);
参考地址:
https://developer.mozilla.org/en-US/docs/XUL/Events#Mutation_DOM_events