Programatically Stepping through a Waterfall

Short of parsing the har, is there any way to step through each request to do some processing using the WPT API

To be more spcific, I want to step through the waterfall to figure out which is the request that contains the actualy html response which is slightly tricky given the 1-n 301/302s that are involved before getting to the page that actually has the response body

For example in this waterfall its request 2 whereas in some others it might even be 3 :

There are other entry points to get the list of requests (jasonResult.php or xmlResult.php) but they will both give you basically the same information as the HAR and you still need to look for the first non-redirect to get the html.

There are also cases where that won’t give you the real page HTML, particularly if a javascript-based redirect is used (setting window.location from script).

One thing you can do for tests that you run is create a custom metric that gets the value of window.location at the end of the test and look for the last response that matches (still not perfect but better).