开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜