Skip to content

Instantly share code, notes, and snippets.

@denieler
Created August 6, 2014 09:26
Show Gist options
  • Save denieler/de7c74a2e21dd084c0c5 to your computer and use it in GitHub Desktop.
Save denieler/de7c74a2e21dd084c0c5 to your computer and use it in GitHub Desktop.
Get Network information from Chrome Developers Tool Console
var network = /*place data*/
$.each( network.log.entries, function(index, entry){
var url = entry.request.url;
var filename = url.substring(url.lastIndexOf('/')+1);
if(filename.indexOf('?')>0)
{
filename = filename.slice(0, filename.indexOf('?'));
}
var time = entry.time.replace('.',',');
var startedDateTime = entry.startedDateTime;
var getLocation = function(href) {
var l = document.createElement("a");
l.href = href;
return l;
};
var l = getLocation(url);
console.log(startedDateTime, ';', filename, ';', url, ';', l.hostname, ';', time);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment