dublintech
dublintech

Reputation: 17785

Trying to figure out origin of HTTP Request

A web application is making a HTTP request and I cannot understand how it is making it. It makes it just after painting a page. There is no 302 in the previous requests and nothing obvious which will tell me how this request is being made.

What would help is if I could set a breakpoint which would stop just before the next HTTP request is about to be sent. Then just after the page is painted, I'd enable this and figure out who is sending it Firebug lets me do this for XHR (Ajax) requests but not for normal requests. This is a normal HTTP request - not an AJAX one.

Is it possible to do this with the debug tools in chrome or IE?

Upvotes: 6

Views: 5230

Answers (4)

dublintech
dublintech

Reputation: 17785

Firstly how I got it.

  1. Disabled javascript on browser - problem still happened this meant that I could rule javascript sending it.
  2. Set max connections on firefox to 1, this meant requests happened sequentially so I could narrow down when / where the requests I couldn't explain getting sent that were.
  3. Finally, found a HTML video tag like this

:

<video id="my_video" class="video-js" width="313" height="240" controls="controls"        preload="none" poster="#">

The part poster="#" was the culprit. This sends a request to the containing page if there is no video to show.

Upvotes: 6

Alexander Pavlov
Alexander Pavlov

Reputation: 32286

In Chrome DevTools, go to the Network panel. Find the respective resource by its name in the leftmost column and look at the Initiator column. It will specify the object that originated the resource load. It can be a Script, in which case it will also contain a hyperlink to the corresponding script line, which loaded the resource. The same holds for the Parser initiator - it will give you a hyperlink to the corresponding HTML line, if it is the one that loaded your resource.

Upvotes: 5

jakub.g
jakub.g

Reputation: 41218

  • From what you say, if it's not XHR, it must be a JavaScript redirect from the previous page.
  • Disable JavaScript and look at the code, searching for code like
    • location = ...
    • location.href = ...
    • window.location = ...
    • window.location.href = ... etc.
  • or something like <meta http-equiv="refresh" content="0;URL='http://example.com/'"> in the <head> of the HTML.
  • Using Tamper Data, when tampering enabled, you can send requests one-by-one, with the pause before each request.
  • Also, you can use Fiddler to see all the HTTP requests initiated by the browser, and do advanced debugging (see bp* commands)
  • You can also go to Firebug's Net panel and click "Persist" to observe all the requests, even after redirects.

Upvotes: 0

Prometheus
Prometheus

Reputation: 33585

Chrome has a version of firebug. http://getfirebug.com/firebuglite

Fiddler supports HTTPS. It's Windows-only, but you didn't specify a platform.

Upvotes: 0

Related Questions