Skip to content

Instantly share code, notes, and snippets.

@Drag13
Created July 25, 2021 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Drag13/d3ef418734736a662d3aedfc2a33fa0c to your computer and use it in GitHub Desktop.
Save Drag13/d3ef418734736a662d3aedfc2a33fa0c to your computer and use it in GitHub Desktop.
Returns list of render blocking resources from the Chrome trace
const { readFileSync } = require("fs");
const rawData = readFileSync('./data.json');
const data = JSON.parse(rawData);
const res = data
.filter(x => x.args?.data?.renderBlocking)
.map(x => ({
timestamp: new Date(x.ts),
url: x.args.data.url,
priority: x.args.data.priority,
blocking: x.args.data.renderBlocking,
}));
console.log(res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment