9

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.

Martin Dimitrov
  • 4,796
  • 5
  • 46
  • 62
  • in firebug you could use Console -> Profile, that will show you the GET and line number – david Oct 16 '11 at 08:25
  • As far as I can see the profiler gives information about the javascript functions that are being executed. But I don't see information about the HTTP requests. – Martin Dimitrov Oct 16 '11 at 08:59
  • I believe you cannot get the exact line number. Just curious, why do you need the line number making the request? – Raghav Oct 17 '11 at 21:39
  • It'd be nice if you could explain your problem or tell us why you need to know in witch file and line the request is made. – Termi Oct 18 '11 at 05:57
  • @Termi: When modifying an existing WordPress site, there were several image requests with 404. I wanted to know where the requests are made, the site has many css files. Not that is that hard to search in the files but such a firebug feature will save several minutes. – Martin Dimitrov Oct 18 '11 at 07:09
  • @Srini: see above comment for possible usage of such a feature – Martin Dimitrov Oct 18 '11 at 07:10
  • @MartinDimitrov see this SO answer to a similar question: it sounds like what you are looking for is possible with Chrome dev tools: http://stackoverflow.com/a/17210212/2482570 – Max Heiber Dec 12 '16 at 21:27

1 Answers1

6

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.

Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
  • Thanks for the reply. I understand that for JavaScript requests it is of little help, but when I was fixing a site with many css files I saw several image requests with 404 error code. I wanted to know where they come from, from which css file. I ended up searching in each one for the image name. Such feature code have saved me several minutes. – Martin Dimitrov Oct 18 '11 at 07:14
  • 1
    I get your point. But I still believe it can be useful to find such information directly in the browser without the need to set up IDE projects and so on. – Martin Dimitrov Oct 18 '11 at 07:56
  • @MartinDimitrov: I agree that would be a welcome Firebug Net panel feature. – Robert Koritnik Oct 18 '11 at 07:58
  • even chrome has the initiator feature – Timo Huovinen Feb 22 '17 at 10:45