Skip to content

Instantly share code, notes, and snippets.

@sand3r
Last active January 7, 2016 15:41
Show Gist options
  • Save sand3r/9c8a400d0a8c4ef1c03d to your computer and use it in GitHub Desktop.
Save sand3r/9c8a400d0a8c4ef1c03d to your computer and use it in GitHub Desktop.
From HAR to a list of copyable files
// If your browser supports window.performance (at least Chrome does) use this:
window.performance.getEntries().forEach(function(resource) { console.log(resource.name); });
// Other way:
// First 'Copy all as HAR' from Network panel.
// Expose result as 'window.HAR'
console.clear();
if(HAR) {
var entries = '';
var body = document.querySelector('body');
var url = '';
body.innerHTML = '';
HAR.log.entries.forEach(function(obj) {
url = obj.request.url;
console.log(url);
entries += url + '<br />';
});
body.innerHTML = entries;
} else {
console.log('HAR not defined.');
}
@sand3r
Copy link
Author

sand3r commented Dec 24, 2015

From HAR to list of files, extracted from the HAR.

From this:
screen shot 2015-12-24 at 13 15 52

To this (a copyable list):
screen shot 2015-12-24 at 13 16 13

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