Marcelo Lazaroni
Marcelo Lazaroni

Reputation: 10247

Find function that made HTTP request in chrome

I can see my HTTP requests in the Network tab. Does Chrome debugger have a way for me to find where in the source code that request was initiated?

Upvotes: 0

Views: 258

Answers (1)

Gerardo Sabetta
Gerardo Sabetta

Reputation: 579

There's a column named Initiator there you can check where the request is triggered but if you're re-utilizing a function for all of your requests like most people do, or using a framework or dependency for any XHR request what you see there might be useless, however you can put a conditional breakpoint there and check the call stack. If you're seeing "Other" in the Initiator column I think you won't be able to get any more answers from the network tab.

My advice is that you put a breakpoint in the function you use for your requests (if you have one) and check the callstack

Upvotes: 1

Related Questions