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

Question

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

Answers 3
Added at 2017-01-03 21:01
Tags
Question

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.

Answers to

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

nr: #1 dodano: 2017-01-03 21:01

Check this chrome extension:

https://chrome.google.com/webstore/detail/ajax-debugger/lgfefckpdealogpcfjdhinecfbcgedam

Please tell me if your problem is resolved! :D

nr: #2 dodano: 2017-01-03 21:01

Since you see the request being made in the Network pane, you can grab the url and then add a XHR breakpoint on that URL:

In the breakpoint panel, on the right of the "Sources" pane

(In the breakpoint panel, on the right of the "Sources" pane)

Hope this helps!

nr: #3 dodano: 2017-01-03 21:01

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.)

Source Show
◀ Wstecz