JS/web debugger to trace origins of HTTP requests?

2019-07-23 13:37发布

问题:

I am looking for a tool that would run in a browser (any browser will do) and show me where each HTTP request originated (HTML source file and line, Javascript, or whatever else).

A bit of background. There is a third-party Web application that can be accessed either directly or through a content-modifying proxy. In the former case it works, in the latter it doesn't. My task is to figure out why the proxy breaks the app, and fix whatever problem there is (normally the proxy should only modifications that do not affect functionality).

I have narrowed it down to a single HTTP request. When accessed directly, the browser issues a GET to one particular address, say http://example.com/foobar.html. When accessed through the proxy, there's no such request. This foobar.html contains an important part of the application, so it won't function without it. Supposedly the proxy breaks some code that ought to issue this request. The problem is that I cannot find this code, and so cannot figure out what exactly is broken. There's nothing that looks remotely like foobar in the entire application.

The application in question is a jumble of obfuscated Javascript that generates other avascript and/or HTML that may contain more Javascript etc. Somewhere along the road it probably generates, piece by piece, some iframe src=... or whatever via document.write, and this chunk of HTML references the needed http://example.com/foobar.html.

So what I need is the ability to tell the browser: "See this address, http://example.com/foobar.html? Whenever there is a request to this address, stop and show me what are you doing!" Hopefully this will let me narrow down my search somewhat more.

I couldn't find such functionality in firebug or venkman. Am I missing something? Is there any other tool that would let me do it?

I see the Referer header of the request in question, but the referring file is very large and obfuscated. So far, I was not able to make anything meaningful out of it.

回答1:

FireBug then the Network Tab...



回答2:

Fiddler - it allows to view and search the HTTP sessions. Be sure to decode sessions when searching.