6

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?

jakub.g
  • 38,512
  • 12
  • 92
  • 130
dublintech
  • 16,815
  • 29
  • 84
  • 115

4 Answers4

6

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.

Brian Webster
  • 30,033
  • 48
  • 152
  • 225
dublintech
  • 16,815
  • 29
  • 84
  • 115
5

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.

Alexander Pavlov
  • 31,598
  • 5
  • 67
  • 93
  • Pavlo, thanks. I try this but lines do not match up. Tell me origin is the JSP it keeps sumbitting to. – dublintech Jul 04 '12 at 11:30
  • Did you try navigating to the blamed line in your JSP output resource? Did it actually name the resource in question? – Alexander Pavlov Jul 04 '12 at 12:44
  • IT did, but what it refers to does not make any sense. I follow the file / line reference and points to the end of a file or a reference to a HTML 5 video tag. – dublintech Jul 04 '12 at 15:03
  • Aha, so what was the **Initiator** value? Was it _Parser_? That sounds like a new element (e.g. ` – Alexander Pavlov Jul 04 '12 at 16:35
  • I get refeferences to Struts Forms which map to JSP but the line numbers don't match anything significant, I also get references to jquery as being the inititator: jquery-all-1.2.js:16, I also get chrome-extension://iembbpgndebhceoikoilmlndnemmamgp/jquery-1.7.1.js:1553 as an initiator. Any more ideas or tips appreciated. – dublintech Jul 09 '12 at 09:18
0

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

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

Prometheus
  • 32,405
  • 54
  • 166
  • 302
0
  • 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.
jakub.g
  • 38,512
  • 12
  • 92
  • 130