Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viewer: allow loading RunnerResult json #7031

Merged
merged 3 commits into from
Jan 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lighthouse-viewer/app/src/lighthouse-report-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ class LighthouseReportViewer {
// TODO: Really, `json` should really have type `unknown` and
// we can have _validateReportJson verify that it's an LH.Result
_replaceReportHtml(json) {
// Allow users to view the runnerResult
if ('lhr' in json) {
json = /** @type {LH.RunnerResult} */ (json).lhr;
}

this._validateReportJson(json);

// Redirect to old viewer if a v2 report. v3 and v4 both handled by v4 viewer.
Expand Down