Chrome's firebug's technic to track ajax requests

左心房为你撑大大i 提交于 2019-11-29 10:44:18
Boris Smus

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.

Currently there is no way of programmatically getting all info about ajax requests similar to Network tab.

There is experimental chrome.experimental.webRequest.onCompleted.addListener, with it you can catch ajax request, get returned response code (200,404), and get some response headers. You won't be able to get response body.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!