Skip to content

Instantly share code, notes, and snippets.

@rudiedirkx
Last active August 29, 2015 14:25
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 rudiedirkx/58679c4816d45dd98891 to your computer and use it in GitHub Desktop.
Save rudiedirkx/58679c4816d45dd98891 to your computer and use it in GitHub Desktop.
javascript:
alert((function(list) {
console.log(list);
var arr = [];
for (var host in list) arr.push(host + ': ' + list[host]);
arr.sort(function(a, b) { return parseInt(b.split(': ')[1]) - parseInt(a.split(': ')[1]); });
return arr;
})(performance.getEntriesByType('resource').reduce(function(list, res) {
var host = res.name.match(/\/\/([^/]+)/)[1];
list[host] ? (list[host]++) : (list[host] = 1);
return list;
}, {})).join("\n"));
void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment