From c379a38412816ef929ba0a3b566dd6aaf36d9211 Mon Sep 17 00:00:00 2001 From: 7h3Rabbit <62792609+7h3Rabbit@users.noreply.github.com> Date: Tue, 15 Apr 2025 18:15:21 +0200 Subject: [PATCH] Fixed issue with failing sanitation --- .../templates/url/waterfall/includeHARinHTML.pug | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/plugins/html/templates/url/waterfall/includeHARinHTML.pug b/lib/plugins/html/templates/url/waterfall/includeHARinHTML.pug index 8867a04f7..9452d623b 100644 --- a/lib/plugins/html/templates/url/waterfall/includeHARinHTML.pug +++ b/lib/plugins/html/templates/url/waterfall/includeHARinHTML.pug @@ -1,10 +1,16 @@ #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('').join('</script>') - +//- Inline script tags break the output +- var dahar = h.get(pageInfo.data, 'browsertime.run.har', summaryPageHAR) +- if (dahar && dahar.log && Array.isArray(dahar.log.entries)) { +- dahar.log.entries.forEach(function(entry) { +- if (entry && entry.response && entry.response.content && entry.response.content.text) { +- entry.response.content.text = "replaced"; +- } +- }); +- } +- dahar = JSON.stringify(dahar.log) script(src= assetsPath + 'js/perf-cascade.min.js') script(type='text/javascript'). const outputHolderEl = document.getElementById("output");