Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 5 | /* eslint-disable rulesdir/no_underscored_properties */ |
| 6 | |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 7 | import * as Common from '../common/common.js'; |
| 8 | import * as Components from '../components/components.js'; |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 9 | import * as Host from '../host/host.js'; |
vidorteg | 0684002 | 2020-11-20 21:18:03 -0800 | [diff] [blame] | 10 | import * as i18n from '../i18n/i18n.js'; |
Simon Zünd | 2c704cd | 2020-06-04 11:08:35 +0200 | [diff] [blame] | 11 | import * as Platform from '../platform/platform.js'; |
Tim van der Lippe | 5df64b2 | 2020-09-11 13:04:24 +0100 | [diff] [blame] | 12 | import * as Root from '../root/root.js'; |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 13 | import * as SDK from '../sdk/sdk.js'; |
Paul Lewis | ca569a5 | 2020-09-09 17:11:51 +0100 | [diff] [blame] | 14 | import * as ThemeSupport from '../theme_support/theme_support.js'; |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 15 | import * as Timeline from '../timeline/timeline.js'; |
| 16 | import * as UI from '../ui/ui.js'; |
Tim van der Lippe | 696c926 | 2020-08-26 15:39:32 +0100 | [diff] [blame] | 17 | import * as Workspace from '../workspace/workspace.js'; |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 18 | |
Tim van der Lippe | 5f62c6f | 2021-02-25 16:39:26 +0000 | [diff] [blame] | 19 | import type * as ReportRenderer from './LighthouseReporterTypes.js'; |
Tim van der Lippe | 1e10f85 | 2020-10-30 14:35:01 +0000 | [diff] [blame] | 20 | |
vidorteg | 0684002 | 2020-11-20 21:18:03 -0800 | [diff] [blame] | 21 | export const UIStrings = { |
| 22 | /** |
| 23 | *@description Label for view trace button when simulated throttling is enabled |
| 24 | */ |
| 25 | viewOriginalTrace: 'View Original Trace', |
| 26 | /** |
| 27 | *@description Text of the timeline button in Lighthouse Report Renderer |
| 28 | */ |
| 29 | viewTrace: 'View Trace', |
| 30 | /** |
| 31 | *@description Help text for 'View Trace' button |
| 32 | */ |
| 33 | thePerformanceMetricsAboveAre: |
| 34 | 'The performance metrics above are simulated and won\'t match the timings found in this trace. Disable simulated throttling in "Lighthouse Settings" if you want the timings to match.', |
| 35 | }; |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 36 | const str_ = i18n.i18n.registerUIStrings('lighthouse/LighthouseReportRenderer.ts', UIStrings); |
vidorteg | 0684002 | 2020-11-20 21:18:03 -0800 | [diff] [blame] | 37 | const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 38 | const MaxLengthForLinks = 40; |
| 39 | |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 40 | // @ts-ignore https://github.com/GoogleChrome/lighthouse/issues/11628 |
Tim van der Lippe | 1e10f85 | 2020-10-30 14:35:01 +0000 | [diff] [blame] | 41 | export class LighthouseReportRenderer extends self.ReportRenderer { |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 42 | constructor(dom: DOM) { |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 +0000 | [diff] [blame] | 43 | super(dom); |
| 44 | } |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 45 | |
| 46 | static addViewTraceButton(el: Element, artifacts?: ReportRenderer.RunnerResultArtifacts): void { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 47 | if (!artifacts || !artifacts.traces || !artifacts.traces.defaultPass) { |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 +0000 | [diff] [blame] | 48 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 49 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 50 | |
Adam Raine | f46d158 | 2020-08-17 20:24:32 +0000 | [diff] [blame] | 51 | const simulated = artifacts.settings.throttlingMethod === 'simulate'; |
cjamcl@google.com | 21d2d22 | 2019-08-09 01:58:17 +0000 | [diff] [blame] | 52 | const container = el.querySelector('.lh-audit-group'); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 53 | if (!container) { |
| 54 | return; |
| 55 | } |
Paul Irish | bf20468 | 2020-05-13 16:11:37 -0700 | [diff] [blame] | 56 | const disclaimerEl = container.querySelector('.lh-metrics__disclaimer'); |
| 57 | // If it was a PWA-only run, we'd have a trace but no perf category to add the button to |
| 58 | if (!disclaimerEl) { |
cjamcl@google.com | 21d2d22 | 2019-08-09 01:58:17 +0000 | [diff] [blame] | 59 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 60 | } |
cjamcl@google.com | 21d2d22 | 2019-08-09 01:58:17 +0000 | [diff] [blame] | 61 | |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 +0000 | [diff] [blame] | 62 | const defaultPassTrace = artifacts.traces.defaultPass; |
vidorteg | 0684002 | 2020-11-20 21:18:03 -0800 | [diff] [blame] | 63 | const label = simulated ? i18nString(UIStrings.viewOriginalTrace) : i18nString(UIStrings.viewTrace); |
Adam Raine | f46d158 | 2020-08-17 20:24:32 +0000 | [diff] [blame] | 64 | const timelineButton = UI.UIUtils.createTextButton(label, onViewTraceClick, 'view-trace'); |
| 65 | if (simulated) { |
Tim van der Lippe | 70842f3 | 2020-11-23 16:56:57 +0000 | [diff] [blame] | 66 | UI.Tooltip.Tooltip.install(timelineButton, i18nString(UIStrings.thePerformanceMetricsAboveAre)); |
Adam Raine | f46d158 | 2020-08-17 20:24:32 +0000 | [diff] [blame] | 67 | } |
Paul Irish | bf20468 | 2020-05-13 16:11:37 -0700 | [diff] [blame] | 68 | container.insertBefore(timelineButton, disclaimerEl.nextSibling); |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 +0000 | [diff] [blame] | 69 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 70 | async function onViewTraceClick(): Promise<void> { |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 71 | Host.userMetrics.actionTaken(Host.UserMetrics.Action.LighthouseViewTrace); |
Tim van der Lippe | 80d8265 | 2020-08-27 14:53:44 +0100 | [diff] [blame] | 72 | await UI.InspectorView.InspectorView.instance().showPanel('timeline'); |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 73 | Timeline.TimelinePanel.TimelinePanel.instance().loadFromEvents(defaultPassTrace.traceEvents); |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 +0000 | [diff] [blame] | 74 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 75 | } |
cjamcl@google.com | da0e4c6 | 2018-11-27 23:52:10 +0000 | [diff] [blame] | 76 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 77 | static async linkifyNodeDetails(el: Element): Promise<void> { |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 78 | const mainTarget = SDK.SDKModel.TargetManager.instance().mainTarget(); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 79 | if (!mainTarget) { |
| 80 | return; |
| 81 | } |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 82 | const domModel = mainTarget.model(SDK.DOMModel.DOMModel); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 83 | if (!domModel) { |
| 84 | return; |
| 85 | } |
cjamcl@google.com | da0e4c6 | 2018-11-27 23:52:10 +0000 | [diff] [blame] | 86 | |
| 87 | for (const origElement of el.getElementsByClassName('lh-node')) { |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 88 | const origHTMLElement = origElement as HTMLElement; |
| 89 | const detailsItem = origHTMLElement.dataset as unknown as ReportRenderer.NodeDetailsJSON; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 90 | if (!detailsItem.path) { |
cjamcl@google.com | 5c46b7e | 2018-12-04 14:44:47 +0000 | [diff] [blame] | 91 | continue; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 92 | } |
cjamcl@google.com | da0e4c6 | 2018-11-27 23:52:10 +0000 | [diff] [blame] | 93 | |
| 94 | const nodeId = await domModel.pushNodeByPathToFrontend(detailsItem.path); |
| 95 | |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 96 | if (!nodeId) { |
cjamcl@google.com | 5c46b7e | 2018-12-04 14:44:47 +0000 | [diff] [blame] | 97 | continue; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 98 | } |
cjamcl@google.com | da0e4c6 | 2018-11-27 23:52:10 +0000 | [diff] [blame] | 99 | const node = domModel.nodeForId(nodeId); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 100 | if (!node) { |
cjamcl@google.com | 5c46b7e | 2018-12-04 14:44:47 +0000 | [diff] [blame] | 101 | continue; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 102 | } |
cjamcl@google.com | da0e4c6 | 2018-11-27 23:52:10 +0000 | [diff] [blame] | 103 | |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 104 | const element = await Common.Linkifier.Linkifier.linkify( |
| 105 | node, {tooltip: detailsItem.snippet, preventKeyboardFocus: undefined}); |
Tim van der Lippe | 70842f3 | 2020-11-23 16:56:57 +0000 | [diff] [blame] | 106 | UI.Tooltip.Tooltip.install(origHTMLElement, ''); |
Connor Clark | 49872c0 | 2020-12-16 13:39:28 -0600 | [diff] [blame] | 107 | |
| 108 | const screenshotElement = origHTMLElement.querySelector('.lh-element-screenshot'); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 109 | origHTMLElement.textContent = ''; |
Connor Clark | 49872c0 | 2020-12-16 13:39:28 -0600 | [diff] [blame] | 110 | if (screenshotElement) { |
| 111 | origHTMLElement.append(screenshotElement); |
| 112 | } |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 113 | origHTMLElement.appendChild(element); |
cjamcl@google.com | da0e4c6 | 2018-11-27 23:52:10 +0000 | [diff] [blame] | 114 | } |
| 115 | } |
cjamcl@google.com | f2f8c09 | 2019-05-30 22:01:56 +0000 | [diff] [blame] | 116 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 117 | static async linkifySourceLocationDetails(el: Element): Promise<void> { |
Connor Clark | 0403a42 | 2019-11-18 18:03:18 -0800 | [diff] [blame] | 118 | for (const origElement of el.getElementsByClassName('lh-source-location')) { |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 119 | const origHTMLElement = origElement as HTMLElement; |
| 120 | const detailsItem = origHTMLElement.dataset as ReportRenderer.SourceLocationDetailsJSON; |
Connor Clark | 0403a42 | 2019-11-18 18:03:18 -0800 | [diff] [blame] | 121 | if (!detailsItem.sourceUrl || !detailsItem.sourceLine || !detailsItem.sourceColumn) { |
| 122 | continue; |
| 123 | } |
| 124 | const url = detailsItem.sourceUrl; |
| 125 | const line = Number(detailsItem.sourceLine); |
| 126 | const column = Number(detailsItem.sourceColumn); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 127 | const element = await Components.Linkifier.Linkifier.linkifyURL(url, { |
| 128 | lineNumber: line, |
| 129 | columnNumber: column, |
| 130 | maxLength: MaxLengthForLinks, |
| 131 | bypassURLTrimming: undefined, |
| 132 | className: undefined, |
| 133 | preventClick: undefined, |
| 134 | tabStop: undefined, |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 135 | text: undefined, |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 136 | }); |
Tim van der Lippe | 70842f3 | 2020-11-23 16:56:57 +0000 | [diff] [blame] | 137 | UI.Tooltip.Tooltip.install(origHTMLElement, ''); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 138 | origHTMLElement.textContent = ''; |
| 139 | origHTMLElement.appendChild(element); |
Connor Clark | 0403a42 | 2019-11-18 18:03:18 -0800 | [diff] [blame] | 140 | } |
| 141 | } |
| 142 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 143 | static handleDarkMode(el: Element): void { |
Paul Lewis | ca569a5 | 2020-09-09 17:11:51 +0100 | [diff] [blame] | 144 | if (ThemeSupport.ThemeSupport.instance().themeName() === 'dark') { |
cjamcl@google.com | f2f8c09 | 2019-05-30 22:01:56 +0000 | [diff] [blame] | 145 | el.classList.add('dark'); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 146 | } |
cjamcl@google.com | f2f8c09 | 2019-05-30 22:01:56 +0000 | [diff] [blame] | 147 | } |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 148 | } |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 149 | |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 150 | // @ts-ignore https://github.com/GoogleChrome/lighthouse/issues/11628 |
Tim van der Lippe | 1e10f85 | 2020-10-30 14:35:01 +0000 | [diff] [blame] | 151 | export class LighthouseReportUIFeatures extends self.ReportUIFeatures { |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 152 | _beforePrint: (() => void)|null; |
| 153 | _afterPrint: (() => void)|null; |
| 154 | |
| 155 | constructor(dom: DOM) { |
Connor Clark | 9950836 | 2019-08-20 19:52:23 +0000 | [diff] [blame] | 156 | super(dom); |
| 157 | this._beforePrint = null; |
| 158 | this._afterPrint = null; |
| 159 | } |
| 160 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 161 | setBeforePrint(beforePrint: (() => void)|null): void { |
Connor Clark | 9950836 | 2019-08-20 19:52:23 +0000 | [diff] [blame] | 162 | this._beforePrint = beforePrint; |
| 163 | } |
| 164 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 165 | setAfterPrint(afterPrint: (() => void)|null): void { |
Connor Clark | 9950836 | 2019-08-20 19:52:23 +0000 | [diff] [blame] | 166 | this._afterPrint = afterPrint; |
| 167 | } |
| 168 | |
| 169 | /** |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 170 | * Returns the html that recreates this report. |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 171 | */ |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 172 | getReportHtml(): string { |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 173 | this.resetUIState(); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 174 | // @ts-ignore https://github.com/GoogleChrome/lighthouse/issues/11628 |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 175 | return Lighthouse.ReportGenerator.generateReportHtml(this.json); |
| 176 | } |
| 177 | |
| 178 | /** |
| 179 | * Downloads a file (blob) using the system dialog prompt. |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 180 | */ |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 181 | async _saveFile(blob: Blob|File): Promise<void> { |
| 182 | // @ts-ignore https://github.com/GoogleChrome/lighthouse/issues/11628 |
Paul Lewis | daac106 | 2020-03-05 14:37:10 +0000 | [diff] [blame] | 183 | const domain = new Common.ParsedURL.ParsedURL(this.json.finalUrl).domain(); |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 184 | const sanitizedDomain = domain.replace(/[^a-z0-9.-]+/gi, '_'); |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 185 | // @ts-ignore https://github.com/GoogleChrome/lighthouse/issues/11628 |
Simon Zünd | 2c704cd | 2020-06-04 11:08:35 +0200 | [diff] [blame] | 186 | const timestamp = Platform.DateUtilities.toISO8601Compact(new Date(this.json.fetchTime)); |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 187 | const ext = blob.type.match('json') ? '.json' : '.html'; |
| 188 | const basename = `${sanitizedDomain}-${timestamp}${ext}`; |
| 189 | const text = await blob.text(); |
Tim van der Lippe | 696c926 | 2020-08-26 15:39:32 +0100 | [diff] [blame] | 190 | Workspace.FileManager.FileManager.instance().save(basename, text, true /* forceSaveAs */); |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 191 | } |
| 192 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 193 | async _print(): Promise<void> { |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 194 | const document = this.getDocument(); |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 195 | const clonedReport = (document.querySelector('.lh-root') as HTMLElement).cloneNode(true); |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 196 | const printWindow = window.open('', '_blank', 'channelmode=1,status=1,resizable=1'); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 197 | if (!printWindow) { |
| 198 | return; |
| 199 | } |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 200 | const style = printWindow.document.createElement('style'); |
Tim van der Lippe | fe3cdc9 | 2020-11-06 15:23:13 +0000 | [diff] [blame] | 201 | style.textContent = Root.Runtime.cachedResources.get('third_party/lighthouse/report-assets/report.css') || ''; |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 202 | printWindow.document.head.appendChild(style); |
| 203 | printWindow.document.body.replaceWith(clonedReport); |
| 204 | // Linkified nodes are shadow elements, which aren't exposed via `cloneNode`. |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 205 | await LighthouseReportRenderer.linkifyNodeDetails(clonedReport as HTMLElement); |
Connor Clark | 9950836 | 2019-08-20 19:52:23 +0000 | [diff] [blame] | 206 | |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 207 | if (this._beforePrint) { |
Connor Clark | 9950836 | 2019-08-20 19:52:23 +0000 | [diff] [blame] | 208 | this._beforePrint(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 209 | } |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 210 | printWindow.focus(); |
| 211 | printWindow.print(); |
| 212 | printWindow.close(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 213 | if (this._afterPrint) { |
Connor Clark | 9950836 | 2019-08-20 19:52:23 +0000 | [diff] [blame] | 214 | this._afterPrint(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 215 | } |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 216 | } |
| 217 | |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 218 | getDocument(): Document { |
| 219 | // @ts-ignore https://github.com/GoogleChrome/lighthouse/issues/11628 |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 220 | return this._document; |
| 221 | } |
Jan Scheffler | c5a400f | 2021-01-22 17:41:47 +0100 | [diff] [blame] | 222 | resetUIState(): void { |
| 223 | // @ts-ignore https://github.com/GoogleChrome/lighthouse/issues/11628 |
cjamcl@google.com | c5214af | 2019-06-25 20:31:21 +0000 | [diff] [blame] | 224 | this._resetUIState(); |
| 225 | } |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 226 | } |