From 3c441371977d8f6fcd6ebf6b639ab867aebbae21 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 10 Nov 2020 12:39:21 -0800 Subject: [PATCH] clients(viewer): extract the LHR from PSI json (#11650) --- lighthouse-viewer/app/src/lighthouse-report-viewer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lighthouse-viewer/app/src/lighthouse-report-viewer.js b/lighthouse-viewer/app/src/lighthouse-report-viewer.js index 39c1dd796e3b..7aa8df02f2f3 100644 --- a/lighthouse-viewer/app/src/lighthouse-report-viewer.js +++ b/lighthouse-viewer/app/src/lighthouse-report-viewer.js @@ -178,6 +178,10 @@ class LighthouseReportViewer { if ('lhr' in json) { json = /** @type {LH.RunnerResult} */ (json).lhr; } + // Allow users to drop in PSI's json + if ('lighthouseResult' in json) { + json = /** @type {{lighthouseResult: LH.Result}} */ (json).lighthouseResult; + } // Install as global for easier debugging // @ts-expect-error