如何在浏览器中获取XHR调用的堆栈跟踪? [英] How to get stack traces for XHR calls in a browser?

查看:625
本文介绍了如何在浏览器中获取XHR调用的堆栈跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有某种方法可以在每次发出HTTP请求时在浏览器中获取堆栈跟踪?我使用的是Chrome开发者工具,但如果有可以使用的工具,我将使用其他工具.

Is there some way that I can get stack traces in a browser every time an HTTP request is made? I'm using Chrome dev tools, but I'll use a different tool, if there is one that can do this.

我想我可以通过猴子补丁XMLHttpRequest抛出一个错误,但这是一个相当尴尬的解决方案.

I suppose I could monkeypatch XMLHttpRequest to throw an error, but that is a fairly awkward solution.

我试图确定为什么发出HTTP请求,并且能够识别导致该请求的高级功能确实会有所帮助.

I am trying to determine why an HTTP request was made, and being able to identify a high level function that led to that request would really help.

推荐答案

如果您使用的是firefox,请使用Firebug插件. 在firebug中,您可以轻松地看到HTTP调用的堆栈. 您可以轻松地看到放置断点的javascript代码.当调试器在断点处停止时,它显示它已经完成的操作栈. 阅读 Firebug教程

If you are using firefox then use Firebug plugin. In firebug, you can easily see the stack of HTTP calls. You can easily see javascript code a put a breakpoint. when debugger stops on breakpoint, it shows the stack of operation it has done to reach till there. Read Firebug Tutorial

这篇关于如何在浏览器中获取XHR调用的堆栈跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆