Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ipcRenderer.on('__markbot-hidden-browser-perf-dom-advice-' + ipcListenerLabel, function (event, data) {
var domAdvice = JSON.parse(data);
ipcRenderer.removeAllListeners('__markbot-hidden-browser-perf-dom-advice-' + ipcListenerLabel);
webLoader.destroy(win);
win = null;
webcoach.runHarAdvice(webcoach.pickAPage(har, 0), webcoach.getHarAdvice()).then(function (harAdvice) {
const coachResults = webcoach.merge(domAdvice, harAdvice);
const coachAdvice = coachResults.advice;
let errors = [];
let messages = [];
let budgetDetails = generateBudgetReport(perf, coachAdvice);
if (doesPassPerfBudget(perf, coachAdvice)) {
messages.push(budgetDetails);
} else {
errors.push(budgetDetails);
}
markbotMain.debug(`Performance score: ${coachAdvice.score}`);
Object.keys(coachAdvice.performance.adviceList).forEach(function (id) {
let advice = coachAdvice.performance.adviceList[id];