Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Firefox how to find out the code line that makes a request?

Is there an extension or Firebug feature that will tells me the exact line and file from which a HTTP request is made?

In Firebug, the Net tab shows the HTTP headers but not the line that triggered the request. The Console tab will report request with error codes and their expected URL but again without the line where the request is made from the CSS, JavaScript or HTML file.

example of Firebug Console tab

Thanks in advance.

EDIT: A possible use case is to be able to quickly see in the browser image requests that return 404 - in which file (there might be several CSS files) the request was initiated and the line.

like image 923
Martin Dimitrov Avatar asked Oct 16 '11 07:10

Martin Dimitrov


People also ask

Where is the request body in Firefox?

Alternatively, in the console (Ctrl+Shift+K or Command+Option+K) right click on the big pane and check "Log Request and Response Bodies".

How do I know if browser is asking for request?

There is absolutely no way to know with certainty if a request came from a browser or something else making an HTTP request. The HTTP protocol allows for the client to set the User Agent arbitrarily.


1 Answers

No Firebug feature (most likely no extension either)

Firebug doesn't display that and what's even more is that most production-level web applications use minified scripts so this info wouldn't be valuable anyway...

If you're developing an app, you don't use minified scripts but then you know which call initiated a request. But if you're looking at other running apps than minification will make it impossible to determine calling code.

Search in files

Many text editors nowadays support search/find in files feature which makes it possible to search several files at once so you don't have to do it manually yourself. Simple editors like Notepad++ support this as well as several IDEs (like Visual Studio). This makes it simple for you to find culprits that requested those missing files1.

1: But I agree... Such feature would be great if supported directly in Firebug.

like image 58
Robert Koritnik Avatar answered Oct 12 '22 15:10

Robert Koritnik