We love the HAR file but it's hard to actually see what the page includes only looking at the file. The PageXray converts a HAR file to a JSON format that is easier to read. We use the format internally in the coach and sitespeed.io. And with PageXray you can use it standalone in your browser.
What do we collect?
- The size and the number of requests per content type
- The size and requests per domain
- The number of requests per response code
- The base domain and the httpVersion used for the base asset (the main HTML document)
- All assets (responses) with the following data: type, url, size, expires (a normalized expires converting max-age/expires to just expires in seconds), status (response code), timeSinceLastModified (using the last modified field in the response header and normalizing to seconds), httpVersion and all request and response headers.
- If you use a HAR from WebPageTest we also get SpeedIndex and other VisualMetrics.
- If your HAR is from sitespeed.io you will also get some extra metrics like SpeedIndex.
npm install pagexray -g
Or if you want to prettify the HAR
pagexray --pretty /path/to/my.har
And if you want to get info per request/response:
pagexray --includeAssets /path/to/my.har
If you want to use it in node, use it like this:
let pagexray = require('pagexray');let har = // your HARlet pages = pagexray.convert(har);
Using in your browser
Include the latest pagexray.min.js (that you find in the relases) on your page. PageXray is exposed as window.PageXray
const pageXray = windowPageXray;
All sizes are in bytes. Expires and timeSinceLastModified are in seconds.