Skip to content

Instantly share code, notes, and snippets.

@okor
Last active August 29, 2015 14:09
Show Gist options
  • Save okor/505d7ec3fd4489b2cc8d to your computer and use it in GitHub Desktop.
Save okor/505d7ec3fd4489b2cc8d to your computer and use it in GitHub Desktop.
Gathering network stats for loaded resources via Chrome console

#The kitchen sink (er thing)

console.table(performance.getEntries())

#Generate a unique array of all domains which load network assets on a webpage ** Requires Underscore or LoDash **

_.uniq(_.map(performance.getEntries(), function(e){ return { duration: e.duration, domain: e.name.split(/http\:\/\/|https\:\/\//)[1].split('/')[0] } }))

Helpful for gaining insight into how many different domains a website is loading resources from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment