INNER CODE UNIT · JavaScript
create
cyrus-and/chrome-har-capturer · lib/har.js:6
function create(pages) {
// HAR template
const packageInfo = require('../package');
const har = {
log: {
version: '1.2',
creator: {
name: 'Chrome HAR Capturer',
version: packageInfo.version,
comment: packageInfo.homepage
},
pages: [],
entries: []
}
};
// fill the HAR template each page info
for (const [pageIndex, stats] of pages.entries()) {
const pageId = `page_${pageIndex + 1}_${String(Math.random()).slice(2)}`;