Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
518 views
in Technique[技术] by (71.8m points)

javascript - Chrome's firebug's technic to track ajax requests

I'm trying to make my google chrome extension to track ajax requests while browsing web. Only way i found is to listen for DOMSubtreeModified event. Event is fired on every single ajax event but there is no additional information about the request. But in Firebug google chrome extension there is ajax requests tracking with many details. I tried to check how they do it in the source code but it's hard for me to understand.

Do You know how to track those events to get some details about request? Maybe someone could take a look at this firebug's technic or maybe someone knows it and could tell me how they do it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There's a few things you can do with the Chrome Developer Tools for debugging AJAX requests:

  1. Look at the network tab. It tracks all (AJAX) requests, their request and response headers.
  2. Enable XHR console logging in the devtools (right-click in the Developer Tools console, and click "Enable XMLHttpRequest logging".
  3. Set an XHR breakpoint.

There's no need for DOM breakpoints in your case. Plus that approach would only work if your AJAX request modifies the DOM tree.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...