AJAX events logging in Google Chrome extension
I'm working on google chrome extension which logs multiple events. I have a problem with AJAX events. I found this code to log every single AJAX event:
document.addEventListener("DOMSubtreeModified", function(event){
console.log("AJAX event");
});
But it logs hundreds of them. Does anybody kno开发者_Go百科w how to distinguish which page element fired which event? And what caused the event (click, mouse move)?
You can get the event type by simply calling event.type
in your callback function. You should get click/mousemove/mouseover etc. Try console.log(event)
and see what else you can find too!
精彩评论