Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 1 | // Copyright 2016 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 16:41:47 | [diff] [blame] | 5 | /* eslint-disable rulesdir/no_underscored_properties */ |
| 6 | |
Tim van der Lippe | 7696157 | 2021-04-06 10:48:07 | [diff] [blame] | 7 | import * as Common from '../../core/common/common.js'; |
Tim van der Lippe | e024731 | 2021-04-01 14:25:30 | [diff] [blame] | 8 | import * as Host from '../../core/host/host.js'; |
Tim van der Lippe | bb352e6 | 2021-04-01 17:57:28 | [diff] [blame] | 9 | import * as i18n from '../../core/i18n/i18n.js'; |
Tim van der Lippe | d8caac4 | 2021-03-31 14:40:44 | [diff] [blame] | 10 | import * as Root from '../../core/root/root.js'; |
Tim van der Lippe | e00b92f | 2021-03-31 16:52:17 | [diff] [blame] | 11 | import * as SDK from '../../core/sdk/sdk.js'; |
Tim van der Lippe | aa61faf | 2021-04-07 15:32:07 | [diff] [blame^] | 12 | import * as UI from '../../ui/legacy/legacy.js'; |
Tim van der Lippe | 7a077eb | 2021-03-23 18:02:11 | [diff] [blame] | 13 | import * as Emulation from '../emulation/emulation.js'; |
Tim van der Lippe | c02a97c | 2020-02-14 14:39:27 | [diff] [blame] | 14 | |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 15 | import {Events, LighthouseController} from './LighthouseController.js'; |
| 16 | import {ProtocolService} from './LighthouseProtocolService.js'; |
Tim van der Lippe | 12fed69 | 2021-03-24 11:45:24 | [diff] [blame] | 17 | |
Tim van der Lippe | 5f62c6f | 2021-02-25 16:39:26 | [diff] [blame] | 18 | import type * as ReportRenderer from './LighthouseReporterTypes.js'; |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 19 | import {LighthouseReportRenderer, LighthouseReportUIFeatures} from './LighthouseReportRenderer.js'; |
| 20 | import {Item, ReportSelector} from './LighthouseReportSelector.js'; |
| 21 | import {StartView} from './LighthouseStartView.js'; |
| 22 | import {StatusView} from './LighthouseStatusView.js'; |
Paul Lewis | 5147419 | 2020-01-09 16:02:22 | [diff] [blame] | 23 | |
Simon Zünd | 6f95e84 | 2021-03-01 07:41:55 | [diff] [blame] | 24 | const UIStrings = { |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 25 | /** |
| 26 | *@description Text that appears when user drag and drop something (for example, a file) in Lighthouse Panel |
| 27 | */ |
| 28 | dropLighthouseJsonHere: 'Drop `Lighthouse` JSON here', |
| 29 | /** |
| 30 | *@description Tooltip text that appears when hovering over the largeicon add button in the Lighthouse Panel |
| 31 | */ |
| 32 | performAnAudit: 'Perform an audit…', |
| 33 | /** |
| 34 | *@description Text to clear everything |
| 35 | */ |
| 36 | clearAll: 'Clear all', |
| 37 | /** |
| 38 | *@description Tooltip text that appears when hovering over the largeicon settings gear in show settings pane setting in start view of the audits panel |
| 39 | */ |
| 40 | lighthouseSettings: '`Lighthouse` settings', |
| 41 | /** |
| 42 | *@description Status header in the Lighthouse panel |
| 43 | */ |
| 44 | printing: 'Printing', |
| 45 | /** |
| 46 | *@description Status text in the Lighthouse panel |
| 47 | */ |
| 48 | thePrintPopupWindowIsOpenPlease: 'The print popup window is open. Please close it to continue.', |
| 49 | /** |
| 50 | *@description Text in Lighthouse Panel |
| 51 | */ |
| 52 | cancelling: 'Cancelling', |
| 53 | }; |
Tim van der Lippe | 7a077eb | 2021-03-23 18:02:11 | [diff] [blame] | 54 | const str_ = i18n.i18n.registerUIStrings('panels/lighthouse/LighthousePanel.ts', UIStrings); |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 55 | const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); |
Andres Olivares | fe25667 | 2021-01-19 16:14:03 | [diff] [blame] | 56 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 57 | let lighthousePanelInstace: LighthousePanel; |
Andres Olivares | fe25667 | 2021-01-19 16:14:03 | [diff] [blame] | 58 | |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 59 | export class LighthousePanel extends UI.Panel.Panel { |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 60 | _protocolService: ProtocolService; |
| 61 | _controller: LighthouseController; |
| 62 | _startView: StartView; |
| 63 | _statusView: StatusView; |
| 64 | _warningText: null; |
| 65 | _unauditableExplanation: null; |
| 66 | _cachedRenderedReports: Map<ReportRenderer.ReportJSON, HTMLElement>; |
| 67 | _dropTarget: UI.DropTarget.DropTarget; |
| 68 | _auditResultsElement: HTMLElement; |
| 69 | _clearButton!: UI.Toolbar.ToolbarButton; |
| 70 | _newButton!: UI.Toolbar.ToolbarButton; |
| 71 | _reportSelector!: ReportSelector; |
| 72 | _settingsPane!: UI.Widget.Widget; |
| 73 | _rightToolbar!: UI.Toolbar.Toolbar; |
| 74 | _showSettingsPaneSetting!: Common.Settings.Setting<boolean>; |
| 75 | _stateBefore?: { |
Sigurd Schneider | 1576186 | 2021-02-04 08:05:36 | [diff] [blame] | 76 | emulation: {enabled: boolean, outlineEnabled: boolean, toolbarControlsEnabled: boolean}, |
| 77 | network: {conditions: SDK.NetworkManager.Conditions}, |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 78 | }; |
| 79 | _isLHAttached?: boolean; |
| 80 | |
| 81 | private constructor() { |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 82 | super('lighthouse'); |
Jack Franklin | 0ca983b | 2020-12-14 10:22:32 | [diff] [blame] | 83 | this.registerRequiredCSS('third_party/lighthouse/report-assets/report.css', {enableLegacyPatching: false}); |
Tim van der Lippe | 7a077eb | 2021-03-23 18:02:11 | [diff] [blame] | 84 | this.registerRequiredCSS('panels/lighthouse/lighthousePanel.css', {enableLegacyPatching: false}); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 85 | |
Paul Lewis | 5147419 | 2020-01-09 16:02:22 | [diff] [blame] | 86 | this._protocolService = new ProtocolService(); |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 87 | this._controller = new LighthouseController(this._protocolService); |
Paul Lewis | 5147419 | 2020-01-09 16:02:22 | [diff] [blame] | 88 | this._startView = new StartView(this._controller); |
| 89 | this._statusView = new StatusView(this._controller); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 90 | |
Adam Raine | 3226e93 | 2020-10-08 14:42:21 | [diff] [blame] | 91 | this._warningText = null; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 92 | this._unauditableExplanation = null; |
| 93 | this._cachedRenderedReports = new Map(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 94 | |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 95 | this._dropTarget = new UI.DropTarget.DropTarget( |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 96 | this.contentElement, [UI.DropTarget.Type.File], i18nString(UIStrings.dropLighthouseJsonHere), |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 97 | this._handleDrop.bind(this)); |
| 98 | |
Paul Lewis | 5147419 | 2020-01-09 16:02:22 | [diff] [blame] | 99 | this._controller.addEventListener(Events.PageAuditabilityChanged, this._refreshStartAuditUI.bind(this)); |
Adam Raine | 3226e93 | 2020-10-08 14:42:21 | [diff] [blame] | 100 | this._controller.addEventListener(Events.PageWarningsChanged, this._refreshWarningsUI.bind(this)); |
Paul Lewis | 5147419 | 2020-01-09 16:02:22 | [diff] [blame] | 101 | this._controller.addEventListener(Events.AuditProgressChanged, this._refreshStatusUI.bind(this)); |
Tim van der Lippe | 37a35ff | 2020-03-03 13:49:02 | [diff] [blame] | 102 | this._controller.addEventListener(Events.RequestLighthouseStart, event => { |
| 103 | this._startLighthouse(event); |
| 104 | }); |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 105 | this._controller.addEventListener(Events.RequestLighthouseCancel, _event => { |
Tim van der Lippe | 37a35ff | 2020-03-03 13:49:02 | [diff] [blame] | 106 | this._cancelLighthouse(); |
| 107 | }); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 108 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 109 | this._renderToolbar(); |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 110 | this._auditResultsElement = this.contentElement.createChild('div', 'lighthouse-results-container'); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 111 | this._renderStartView(); |
| 112 | |
| 113 | this._controller.recomputePageAuditability(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 114 | } |
| 115 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 116 | static instance(opts = {forceNew: null}): LighthousePanel { |
Andres Olivares | fe25667 | 2021-01-19 16:14:03 | [diff] [blame] | 117 | const {forceNew} = opts; |
| 118 | if (!lighthousePanelInstace || forceNew) { |
| 119 | lighthousePanelInstace = new LighthousePanel(); |
| 120 | } |
| 121 | |
| 122 | return lighthousePanelInstace; |
| 123 | } |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 124 | |
| 125 | static getEvents(): typeof Events { |
Adam Raine | 3226e93 | 2020-10-08 14:42:21 | [diff] [blame] | 126 | return Events; |
| 127 | } |
| 128 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 129 | _refreshWarningsUI(evt: Common.EventTarget.EventTargetEvent): void { |
Adam Raine | 3226e93 | 2020-10-08 14:42:21 | [diff] [blame] | 130 | // PageWarningsChanged fires multiple times during an audit, which we want to ignore. |
| 131 | if (this._isLHAttached) { |
| 132 | return; |
| 133 | } |
| 134 | |
| 135 | this._warningText = evt.data.warning; |
| 136 | this._startView.setWarningText(evt.data.warning); |
| 137 | } |
| 138 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 139 | _refreshStartAuditUI(evt: Common.EventTarget.EventTargetEvent): void { |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 140 | // PageAuditabilityChanged fires multiple times during an audit, which we want to ignore. |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 141 | if (this._isLHAttached) { |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 142 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 143 | } |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 144 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 145 | this._unauditableExplanation = evt.data.helpText; |
| 146 | this._startView.setUnauditableExplanation(evt.data.helpText); |
| 147 | this._startView.setStartButtonEnabled(!evt.data.helpText); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 148 | } |
| 149 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 150 | _refreshStatusUI(evt: Common.EventTarget.EventTargetEvent): void { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 151 | this._statusView.updateStatus(evt.data.message); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 152 | } |
| 153 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 154 | _refreshToolbarUI(): void { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 155 | this._clearButton.setEnabled(this._reportSelector.hasItems()); |
| 156 | } |
| 157 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 158 | _clearAll(): void { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 159 | this._reportSelector.clearAll(); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 160 | this._renderStartView(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 161 | this._refreshToolbarUI(); |
| 162 | } |
| 163 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 164 | _renderToolbar(): void { |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 165 | const lighthouseToolbarContainer = this.element.createChild('div', 'lighthouse-toolbar-container'); |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 166 | |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 167 | const toolbar = new UI.Toolbar.Toolbar('', lighthouseToolbarContainer); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 168 | |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 169 | this._newButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.performAnAudit), 'largeicon-add'); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 170 | toolbar.appendToolbarItem(this._newButton); |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 171 | this._newButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this._renderStartView.bind(this)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 172 | |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 173 | toolbar.appendSeparator(); |
| 174 | |
Paul Lewis | 5147419 | 2020-01-09 16:02:22 | [diff] [blame] | 175 | this._reportSelector = new ReportSelector(() => this._renderStartView()); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 176 | toolbar.appendToolbarItem(this._reportSelector.comboBox()); |
| 177 | |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 178 | this._clearButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clearAll), 'largeicon-clear'); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 179 | toolbar.appendToolbarItem(this._clearButton); |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 180 | this._clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, this._clearAll.bind(this)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 181 | |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 182 | this._settingsPane = new UI.Widget.HBox(); |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 183 | this._settingsPane.show(this.contentElement); |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 184 | this._settingsPane.element.classList.add('lighthouse-settings-pane'); |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 185 | this._settingsPane.element.appendChild(this._startView.settingsToolbar().element); |
Paul Lewis | 2d7d65c | 2020-03-16 17:26:30 | [diff] [blame] | 186 | this._showSettingsPaneSetting = |
| 187 | Common.Settings.Settings.instance().createSetting('lighthouseShowSettingsToolbar', false); |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 188 | |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 189 | this._rightToolbar = new UI.Toolbar.Toolbar('', lighthouseToolbarContainer); |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 190 | this._rightToolbar.appendSeparator(); |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 191 | this._rightToolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingToggle( |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 192 | this._showSettingsPaneSetting, 'largeicon-settings-gear', i18nString(UIStrings.lighthouseSettings))); |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 193 | this._showSettingsPaneSetting.addChangeListener(this._updateSettingsPaneVisibility.bind(this)); |
| 194 | this._updateSettingsPaneVisibility(); |
| 195 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 196 | this._refreshToolbarUI(); |
| 197 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 198 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 199 | _updateSettingsPaneVisibility(): void { |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 200 | this._settingsPane.element.classList.toggle('hidden', !this._showSettingsPaneSetting.get()); |
| 201 | } |
| 202 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 203 | _toggleSettingsDisplay(show: boolean): void { |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 204 | this._rightToolbar.element.classList.toggle('hidden', !show); |
| 205 | this._settingsPane.element.classList.toggle('hidden', !show); |
| 206 | this._updateSettingsPaneVisibility(); |
| 207 | } |
| 208 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 209 | _renderStartView(): void { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 210 | this._auditResultsElement.removeChildren(); |
| 211 | this._statusView.hide(); |
| 212 | |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 213 | this._reportSelector.selectNewReport(); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 214 | this.contentElement.classList.toggle('in-progress', false); |
| 215 | |
| 216 | this._startView.show(this.contentElement); |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 217 | this._toggleSettingsDisplay(true); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 218 | this._startView.setUnauditableExplanation(this._unauditableExplanation); |
| 219 | this._startView.setStartButtonEnabled(!this._unauditableExplanation); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 220 | if (!this._unauditableExplanation) { |
Patrick Hulce | 8d387f1 | 2018-05-29 18:54:54 | [diff] [blame] | 221 | this._startView.focusStartButton(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 222 | } |
Adam Raine | 3226e93 | 2020-10-08 14:42:21 | [diff] [blame] | 223 | this._startView.setWarningText(this._warningText); |
Patrick Hulce | 8d387f1 | 2018-05-29 18:54:54 | [diff] [blame] | 224 | |
Patrick Hulce | 05c18ce | 2018-05-24 00:34:56 | [diff] [blame] | 225 | this._newButton.setEnabled(false); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 226 | this._refreshToolbarUI(); |
Patrick Hulce | 05c18ce | 2018-05-24 00:34:56 | [diff] [blame] | 227 | this.setDefaultFocusedChild(this._startView); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 228 | } |
| 229 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 230 | _renderStatusView(inspectedURL: string): void { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 231 | this.contentElement.classList.toggle('in-progress', true); |
| 232 | this._statusView.setInspectedURL(inspectedURL); |
| 233 | this._statusView.show(this.contentElement); |
| 234 | } |
| 235 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 236 | _beforePrint(): void { |
Connor Clark | 9950836 | 2019-08-20 19:52:23 | [diff] [blame] | 237 | this._statusView.show(this.contentElement); |
| 238 | this._statusView.toggleCancelButton(false); |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 239 | this._statusView.renderText(i18nString(UIStrings.printing), i18nString(UIStrings.thePrintPopupWindowIsOpenPlease)); |
Connor Clark | 9950836 | 2019-08-20 19:52:23 | [diff] [blame] | 240 | } |
| 241 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 242 | _afterPrint(): void { |
Connor Clark | 9950836 | 2019-08-20 19:52:23 | [diff] [blame] | 243 | this._statusView.hide(); |
| 244 | this._statusView.toggleCancelButton(true); |
| 245 | } |
| 246 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 247 | _renderReport(lighthouseResult: ReportRenderer.ReportJSON, artifacts?: ReportRenderer.RunnerResultArtifacts): void { |
Connor Clark | e66080e | 2019-11-07 00:35:51 | [diff] [blame] | 248 | this._toggleSettingsDisplay(false); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 249 | this.contentElement.classList.toggle('in-progress', false); |
| 250 | this._startView.hideWidget(); |
| 251 | this._statusView.hide(); |
| 252 | this._auditResultsElement.removeChildren(); |
Patrick Hulce | 05c18ce | 2018-05-24 00:34:56 | [diff] [blame] | 253 | this._newButton.setEnabled(true); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 254 | this._refreshToolbarUI(); |
| 255 | |
| 256 | const cachedRenderedReport = this._cachedRenderedReports.get(lighthouseResult); |
| 257 | if (cachedRenderedReport) { |
| 258 | this._auditResultsElement.appendChild(cachedRenderedReport); |
| 259 | return; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 260 | } |
| 261 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 262 | const reportContainer = this._auditResultsElement.createChild('div', 'lh-vars lh-root lh-devtools'); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 263 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 264 | const dom = new DOM(this._auditResultsElement.ownerDocument as Document); |
| 265 | const renderer = new LighthouseReportRenderer(dom) as ReportRenderer.ReportRenderer; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 266 | |
Tim van der Lippe | 5df64b2 | 2020-09-11 12:04:24 | [diff] [blame] | 267 | const templatesHTML = Root.Runtime.cachedResources.get('third_party/lighthouse/report-assets/templates.html'); |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 | [diff] [blame] | 268 | if (!templatesHTML) { |
| 269 | return; |
| 270 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 271 | const templatesDOM = new DOMParser().parseFromString(templatesHTML, 'text/html'); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 272 | if (!templatesDOM) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 273 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 274 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 275 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 276 | renderer.setTemplateContext(templatesDOM); |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 | [diff] [blame] | 277 | const el = renderer.renderReport(lighthouseResult, reportContainer); |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 278 | LighthouseReportRenderer.addViewTraceButton(el, artifacts); |
[email protected] | c5214af | 2019-06-25 20:31:21 | [diff] [blame] | 279 | // Linkifying requires the target be loaded. Do not block the report |
| 280 | // from rendering, as this is just an embellishment and the main target |
| 281 | // could take awhile to load. |
| 282 | this._waitForMainTargetLoad().then(() => { |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 283 | LighthouseReportRenderer.linkifyNodeDetails(el); |
| 284 | LighthouseReportRenderer.linkifySourceLocationDetails(el); |
[email protected] | c5214af | 2019-06-25 20:31:21 | [diff] [blame] | 285 | }); |
Connor Clark | 2bc3be2 | 2020-02-14 22:34:19 | [diff] [blame] | 286 | LighthouseReportRenderer.handleDarkMode(el); |
[email protected] | f2f8c09 | 2019-05-30 22:01:56 | [diff] [blame] | 287 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 288 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 289 | const features = new LighthouseReportUIFeatures(dom) as any; |
Connor Clark | 9950836 | 2019-08-20 19:52:23 | [diff] [blame] | 290 | features.setBeforePrint(this._beforePrint.bind(this)); |
| 291 | features.setAfterPrint(this._afterPrint.bind(this)); |
[email protected] | f2f8c09 | 2019-05-30 22:01:56 | [diff] [blame] | 292 | features.setTemplateContext(templatesDOM); |
| 293 | features.initFeatures(lighthouseResult); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 294 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 295 | this._cachedRenderedReports.set(lighthouseResult, reportContainer); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 296 | } |
| 297 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 298 | async _waitForMainTargetLoad(): Promise<void> { |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 299 | const mainTarget = SDK.SDKModel.TargetManager.instance().mainTarget(); |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 | [diff] [blame] | 300 | if (!mainTarget) { |
| 301 | return; |
| 302 | } |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 303 | const resourceTreeModel = mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel); |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 | [diff] [blame] | 304 | if (!resourceTreeModel) { |
| 305 | return; |
| 306 | } |
[email protected] | c5214af | 2019-06-25 20:31:21 | [diff] [blame] | 307 | return resourceTreeModel.once(SDK.ResourceTreeModel.Events.Load); |
| 308 | } |
| 309 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 310 | _buildReportUI(lighthouseResult: ReportRenderer.ReportJSON, artifacts?: ReportRenderer.RunnerResultArtifacts): void { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 311 | if (lighthouseResult === null) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 312 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 313 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 314 | |
Paul Lewis | 5147419 | 2020-01-09 16:02:22 | [diff] [blame] | 315 | const optionElement = new Item( |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 | [diff] [blame] | 316 | lighthouseResult, () => this._renderReport(lighthouseResult, artifacts), this._renderStartView.bind(this)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 317 | this._reportSelector.prepend(optionElement); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 318 | this._refreshToolbarUI(); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 319 | this._renderReport(lighthouseResult); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 320 | } |
| 321 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 322 | _handleDrop(dataTransfer: DataTransfer): void { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 323 | const items = dataTransfer.items; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 324 | if (!items.length) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 325 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 326 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 327 | const item = items[0]; |
| 328 | if (item.kind === 'file') { |
| 329 | const entry = items[0].webkitGetAsEntry(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 330 | if (!entry.isFile) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 331 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 332 | } |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 333 | entry.file((file: Blob) => { |
| 334 | const reader = new FileReader(); |
| 335 | reader.onload = (): void => this._loadedFromFile(reader.result as string); |
| 336 | reader.readAsText(file); |
| 337 | }); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 338 | } |
| 339 | } |
| 340 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 341 | _loadedFromFile(report: string): void { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 342 | const data = JSON.parse(report); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 343 | if (!data['lighthouseVersion']) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 344 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 345 | } |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 346 | this._buildReportUI(data as ReportRenderer.ReportJSON); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 347 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 348 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 349 | async _startLighthouse(_event: Common.EventTarget.EventTargetEvent): Promise<void> { |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 | [diff] [blame] | 350 | Host.userMetrics.actionTaken(Host.UserMetrics.Action.LighthouseStarted); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 351 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 352 | try { |
| 353 | const inspectedURL = await this._controller.getInspectedURL({force: true}); |
| 354 | const categoryIDs = this._controller.getCategoryIDs(); |
| 355 | const flags = this._controller.getFlags(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 356 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 357 | await this._setupEmulationAndProtocolConnection(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 358 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 359 | this._renderStatusView(inspectedURL); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 360 | |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 | [diff] [blame] | 361 | const lighthouseResponse = await this._protocolService.startLighthouse(inspectedURL, categoryIDs, flags); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 362 | |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 | [diff] [blame] | 363 | if (lighthouseResponse && lighthouseResponse.fatal) { |
| 364 | const error = new Error(lighthouseResponse.message); |
| 365 | error.stack = lighthouseResponse.stack; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 366 | throw error; |
| 367 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 368 | |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 369 | if (!lighthouseResponse) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 370 | throw new Error('Auditing failed to produce a result'); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 371 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 372 | |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 | [diff] [blame] | 373 | Host.userMetrics.actionTaken(Host.UserMetrics.Action.LighthouseFinished); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 374 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 375 | await this._resetEmulationAndProtocolConnection(); |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 | [diff] [blame] | 376 | this._buildReportUI(lighthouseResponse.lhr, lighthouseResponse.artifacts); |
Brandon Goddard | 04d5ba9 | 2019-12-19 16:31:55 | [diff] [blame] | 377 | // Give focus to the new audit button when completed |
| 378 | this._newButton.element.focus(); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 379 | } catch (err) { |
Paul Irish | dca01d0 | 2019-03-25 20:17:56 | [diff] [blame] | 380 | await this._resetEmulationAndProtocolConnection(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 381 | if (err instanceof Error) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 382 | this._statusView.renderBugReport(err); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 383 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 384 | } |
| 385 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 386 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 387 | async _cancelLighthouse(): Promise<void> { |
vidorteg | 0684002 | 2020-11-21 05:18:03 | [diff] [blame] | 388 | this._statusView.updateStatus(i18nString(UIStrings.cancelling)); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 389 | await this._resetEmulationAndProtocolConnection(); |
| 390 | this._renderStartView(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 391 | } |
| 392 | |
Paul Irish | d849501 | 2019-07-16 23:51:47 | [diff] [blame] | 393 | /** |
| 394 | * We set the device emulation on the DevTools-side for two reasons: |
| 395 | * 1. To workaround some odd device metrics emulation bugs like occuluding viewports |
| 396 | * 2. To get the attractive device outline |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 397 | * |
Connor Clark | 3ee5ac7 | 2019-11-07 23:11:58 | [diff] [blame] | 398 | * We also set flags.internalDisableDeviceScreenEmulation = true to let LH only apply UA emulation |
Paul Irish | d849501 | 2019-07-16 23:51:47 | [diff] [blame] | 399 | */ |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 400 | async _setupEmulationAndProtocolConnection(): Promise<void> { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 401 | const flags = this._controller.getFlags(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 402 | |
Jack Franklin | 6f3ee6c | 2020-10-22 12:54:10 | [diff] [blame] | 403 | const emulationModel = Emulation.DeviceModeModel.DeviceModeModel.instance(); |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 404 | this._stateBefore = { |
| 405 | emulation: { |
| 406 | enabled: emulationModel.enabledSetting().get(), |
| 407 | outlineEnabled: emulationModel.deviceOutlineSetting().get(), |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 408 | toolbarControlsEnabled: emulationModel.toolbarControlsEnabledSetting().get(), |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 409 | }, |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 410 | network: {conditions: SDK.NetworkManager.MultitargetNetworkManager.instance().networkConditions()}, |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 411 | }; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 412 | |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 413 | emulationModel.toolbarControlsEnabledSetting().set(false); |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 | [diff] [blame] | 414 | if ('emulatedFormFactor' in flags && flags.emulatedFormFactor === 'desktop') { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 415 | emulationModel.enabledSetting().set(false); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 416 | emulationModel.emulate(Emulation.DeviceModeModel.Type.None, null, null); |
Connor Clark | 3f70034 | 2019-07-25 02:10:41 | [diff] [blame] | 417 | } else if (flags.emulatedFormFactor === 'mobile') { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 418 | emulationModel.enabledSetting().set(true); |
| 419 | emulationModel.deviceOutlineSetting().set(true); |
| 420 | |
Paul Lewis | daac106 | 2020-03-05 14:37:10 | [diff] [blame] | 421 | for (const device of Emulation.EmulatedDevices.EmulatedDevicesList.instance().standard()) { |
Paul Irish | ac18cd0 | 2020-05-13 00:57:44 | [diff] [blame] | 422 | if (device.title === 'Moto G4') { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 423 | emulationModel.emulate(Emulation.DeviceModeModel.Type.Device, device, device.modes[0], 1); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 424 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 425 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 426 | } |
| 427 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 428 | await this._protocolService.attach(); |
| 429 | this._isLHAttached = true; |
| 430 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 431 | |
Jan Scheffler | c5a400f | 2021-01-22 16:41:47 | [diff] [blame] | 432 | async _resetEmulationAndProtocolConnection(): Promise<void> { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 433 | if (!this._isLHAttached) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 434 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 | [diff] [blame] | 435 | } |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 436 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 437 | this._isLHAttached = false; |
| 438 | await this._protocolService.detach(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 439 | |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 440 | if (this._stateBefore) { |
Jack Franklin | 6f3ee6c | 2020-10-22 12:54:10 | [diff] [blame] | 441 | const emulationModel = Emulation.DeviceModeModel.DeviceModeModel.instance(); |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 442 | emulationModel.enabledSetting().set(this._stateBefore.emulation.enabled); |
| 443 | emulationModel.deviceOutlineSetting().set(this._stateBefore.emulation.outlineEnabled); |
| 444 | emulationModel.toolbarControlsEnabledSetting().set(this._stateBefore.emulation.toolbarControlsEnabled); |
Tim van der Lippe | cd0bb37 | 2020-05-01 13:53:21 | [diff] [blame] | 445 | SDK.NetworkManager.MultitargetNetworkManager.instance().setNetworkConditions( |
| 446 | this._stateBefore.network.conditions); |
Connor Clark | ca8905e | 2019-08-23 18:35:10 | [diff] [blame] | 447 | delete this._stateBefore; |
| 448 | } |
| 449 | |
Jack Franklin | db9cb27 | 2020-10-15 13:11:26 | [diff] [blame] | 450 | Emulation.InspectedPagePlaceholder.InspectedPagePlaceholder.instance().update(true); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 451 | |
Tim van der Lippe | 4df32c9 | 2020-11-06 12:35:05 | [diff] [blame] | 452 | const mainTarget = SDK.SDKModel.TargetManager.instance().mainTarget(); |
| 453 | if (!mainTarget) { |
| 454 | return; |
| 455 | } |
| 456 | const resourceTreeModel = mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel); |
| 457 | if (!resourceTreeModel) { |
| 458 | return; |
| 459 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 | [diff] [blame] | 460 | // reload to reset the page state |
| 461 | const inspectedURL = await this._controller.getInspectedURL(); |
| 462 | await resourceTreeModel.navigate(inspectedURL); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 | [diff] [blame] | 463 | } |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 | [diff] [blame] | 464 | } |