sitespeed.io/lib/plugins/html/templates/url/waterfall/includeHARinHTML.pug

27 lines
964 B
Plaintext

#output
//- When we inline the data, we cut the HAR to just be one
//- specific run (the median run) in summaryPageHAR.
//- Inline script tags breaks the output
- dahar = h.get(pageInfo.data, 'browsertime.run.har', summaryPageHAR)
- dahar = JSON.stringify(dahar.log).split('</script>').join('&lt;/script&gt;')
script(src= assetsPath + 'js/perf-cascade.min.js')
script(type='text/javascript').
const outputHolderEl = document.getElementById("output");
const pageSelectorEl = document.getElementById("page-selector");
const legendHolderEl = document.getElementById("legend-holder");
const options = {
rowHeight: 23,
showAlignmentHelpers : false,
showIndicatorIcons: false,
showMimeTypeIcon: true,
leftColumnWidth: 30,
legendHolder: legendHolderEl,
selectedPage: #{harIndex},
pageSelector: pageSelectorEl
};
const perfCascadeSvg = perfCascade.fromHar(!{dahar}, options);
outputHolderEl.appendChild(perfCascadeSvg);