Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find where in the code an http request was made using chrome dev tools

Is there any way using chrome dev tools to find where an http request (ajax) was made? I have a large project with many requests happening in different files. There's a particular request that I want to be able to inspect, I've found it on the Network tab, but there doesn't seem to be any way to find where in the code was this request started.

like image 308
StackOverMySoul Avatar asked Jan 03 '17 20:01

StackOverMySoul


People also ask

How do I see HTTP requests in dev tools?

Right click -> inspect -> then you will have the chrome dev tools just by selecting networks you can filter what's the browser is loading also you can see the http request going through your application.


1 Answers

Use the Initiator column in the Network panel. Clicking on the link in the Initiator cell takes you to the line of code where the request was made.

initiator column

If you can't see it, right-click on the table header and select Initiator.

You can also hold Shift while hovering over a resource to see it's initiator. The initiator is green. Dependencies are red. If you can't see the initiator, then it's not currently visible on the table (could be higher up, filtered out, etc.)

MacPrawn's XHR Breakpoint idea is a good approach, too.

like image 116
Kayce Basques Avatar answered Oct 26 '22 15:10

Kayce Basques