Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +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 | |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 5 | Audits.StatusView = class { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 6 | /** |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 7 | * @param {!Audits.AuditController} controller |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 8 | */ |
| 9 | constructor(controller) { |
| 10 | this._controller = controller; |
| 11 | |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 12 | this._statusView = null; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 13 | this._statusHeader = null; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 14 | this._progressWrapper = null; |
| 15 | this._progressBar = null; |
| 16 | this._statusText = null; |
| 17 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 18 | this._inspectedURL = ''; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 19 | this._textChangedAt = 0; |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 20 | this._fastFactsQueued = Audits.StatusView.FastFacts.slice(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 21 | this._currentPhase = null; |
| 22 | this._scheduledTextChangeTimeout = null; |
| 23 | this._scheduledFastFactTimeout = null; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 24 | |
| 25 | this._dialog = new UI.Dialog(); |
Patrick Hulce | 8d387f1 | 2018-05-29 18:54:54 +0000 | [diff] [blame] | 26 | this._dialog.setDimmed(true); |
| 27 | this._dialog.setCloseOnEscape(false); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 28 | this._dialog.setOutsideClickCallback(event => event.consume(true)); |
| 29 | this._render(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 30 | } |
| 31 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 32 | _render() { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 33 | const dialogRoot = UI.createShadowRootWithCoreStyles(this._dialog.contentElement, 'audits/auditsDialog.css'); |
| 34 | const auditsViewElement = dialogRoot.createChild('div', 'audits-view vbox'); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 35 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 36 | const cancelButton = UI.createTextButton(ls`Cancel`, this._cancel.bind(this)); |
| 37 | const fragment = UI.Fragment.build` |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 38 | <div class="audits-view vbox"> |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 39 | <h2 $="status-header">Auditing your web page\u2026</h2> |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 40 | <div class="audits-status vbox" $="status-view"> |
| 41 | <div class="audits-progress-wrapper" $="progress-wrapper"> |
| 42 | <div class="audits-progress-bar" $="progress-bar"></div> |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 43 | </div> |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 44 | <div class="audits-status-text" $="status-text"></div> |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 45 | </div> |
| 46 | ${cancelButton} |
| 47 | </div> |
| 48 | `; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 49 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 50 | auditsViewElement.appendChild(fragment.element()); |
| 51 | auditsViewElement.tabIndex = 0; |
| 52 | |
| 53 | this._statusView = fragment.$('status-view'); |
| 54 | this._statusHeader = fragment.$('status-header'); |
| 55 | this._progressWrapper = fragment.$('progress-wrapper'); |
| 56 | this._progressBar = fragment.$('progress-bar'); |
| 57 | this._statusText = fragment.$('status-text'); |
| 58 | |
| 59 | this._dialog.setDefaultFocusedElement(cancelButton); |
| 60 | this._dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.SetExactWidthMaxHeight); |
| 61 | this._dialog.setMaxContentSize(new UI.Size(500, 400)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 62 | } |
| 63 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 64 | _reset() { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 65 | this._resetProgressBarClasses(); |
| 66 | clearTimeout(this._scheduledFastFactTimeout); |
| 67 | |
| 68 | this._textChangedAt = 0; |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 69 | this._fastFactsQueued = Audits.StatusView.FastFacts.slice(); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 70 | this._currentPhase = null; |
| 71 | this._scheduledTextChangeTimeout = null; |
| 72 | this._scheduledFastFactTimeout = null; |
| 73 | } |
| 74 | |
| 75 | /** |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 76 | * @param {!Element} dialogRenderElement |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 77 | */ |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 78 | show(dialogRenderElement) { |
| 79 | this._reset(); |
| 80 | this.updateStatus(ls`Loading\u2026`); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 81 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 82 | const parsedURL = this._inspectedURL.asParsedURL(); |
| 83 | const pageHost = parsedURL && parsedURL.host; |
| 84 | const statusHeader = pageHost ? ls`Auditing ${pageHost}` : ls`Auditing your web page`; |
| 85 | this._statusHeader.textContent = `${statusHeader}\u2026`; |
| 86 | this._dialog.show(dialogRenderElement); |
| 87 | } |
| 88 | |
| 89 | hide() { |
| 90 | if (this._dialog.isShowing()) |
| 91 | this._dialog.hide(); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * @param {string=} url |
| 96 | */ |
| 97 | setInspectedURL(url = '') { |
| 98 | this._inspectedURL = url; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | /** |
| 102 | * @param {?string} message |
| 103 | */ |
| 104 | updateStatus(message) { |
| 105 | if (!message || !this._statusText) |
| 106 | return; |
| 107 | |
| 108 | if (message.startsWith('Cancel')) { |
| 109 | this._commitTextChange(Common.UIString('Cancelling\u2026')); |
| 110 | clearTimeout(this._scheduledFastFactTimeout); |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | const nextPhase = this._getPhaseForMessage(message); |
| 115 | if (!nextPhase && !this._currentPhase) { |
| 116 | this._commitTextChange(Common.UIString('Lighthouse is warming up\u2026')); |
| 117 | clearTimeout(this._scheduledFastFactTimeout); |
| 118 | } else if (nextPhase && (!this._currentPhase || this._currentPhase.order < nextPhase.order)) { |
| 119 | this._currentPhase = nextPhase; |
| 120 | this._scheduleTextChange(this._getMessageForPhase(nextPhase)); |
| 121 | this._scheduleFastFactCheck(); |
| 122 | this._resetProgressBarClasses(); |
| 123 | this._progressBar.classList.add(nextPhase.progressBarClass); |
| 124 | } |
| 125 | } |
| 126 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 127 | _cancel() { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 128 | this._controller.dispatchEventToListeners(Audits.Events.RequestAuditCancel); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 129 | } |
| 130 | |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 131 | /** |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 132 | * @param {!Audits.StatusView.StatusPhases} phase |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 133 | * @return {string} |
| 134 | */ |
| 135 | _getMessageForPhase(phase) { |
| 136 | if (phase.message) |
| 137 | return Common.UIString(phase.message); |
| 138 | |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 139 | const deviceType = Audits.RuntimeSettings.find(item => item.setting.name === 'audits.device_type').setting.get(); |
| 140 | const throttling = Audits.RuntimeSettings.find(item => item.setting.name === 'audits.throttling').setting.get(); |
| 141 | const match = Audits.StatusView.LoadingMessages.find(item => { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 142 | return item.deviceType === deviceType && item.throttling === throttling; |
| 143 | }); |
| 144 | |
| 145 | return match ? ls`${match.message}` : ls`Lighthouse is loading your page`; |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * @param {string} message |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 150 | * @return {?Audits.StatusView.StatusPhases} |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 151 | */ |
| 152 | _getPhaseForMessage(message) { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 153 | return Audits.StatusView.StatusPhases.find(phase => message.startsWith(phase.statusMessagePrefix)); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | _resetProgressBarClasses() { |
| 157 | if (!this._progressBar) |
| 158 | return; |
| 159 | |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 160 | this._progressBar.className = 'audits-progress-bar'; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | _scheduleFastFactCheck() { |
| 164 | if (!this._currentPhase || this._scheduledFastFactTimeout) |
| 165 | return; |
| 166 | |
| 167 | this._scheduledFastFactTimeout = setTimeout(() => { |
| 168 | this._updateFastFactIfNecessary(); |
| 169 | this._scheduledFastFactTimeout = null; |
| 170 | |
| 171 | this._scheduleFastFactCheck(); |
| 172 | }, 100); |
| 173 | } |
| 174 | |
| 175 | _updateFastFactIfNecessary() { |
| 176 | const now = performance.now(); |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 177 | if (now - this._textChangedAt < Audits.StatusView.fastFactRotationInterval) |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 178 | return; |
| 179 | if (!this._fastFactsQueued.length) |
| 180 | return; |
| 181 | |
| 182 | const fastFactIndex = Math.floor(Math.random() * this._fastFactsQueued.length); |
| 183 | this._scheduleTextChange(ls`\ud83d\udca1 ${this._fastFactsQueued[fastFactIndex]}`); |
| 184 | this._fastFactsQueued.splice(fastFactIndex, 1); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * @param {string} text |
| 189 | */ |
| 190 | _commitTextChange(text) { |
| 191 | if (!this._statusText) |
| 192 | return; |
| 193 | this._textChangedAt = performance.now(); |
| 194 | this._statusText.textContent = text; |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * @param {string} text |
| 199 | */ |
| 200 | _scheduleTextChange(text) { |
| 201 | if (this._scheduledTextChangeTimeout) |
| 202 | clearTimeout(this._scheduledTextChangeTimeout); |
| 203 | |
| 204 | const msSinceLastChange = performance.now() - this._textChangedAt; |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 205 | const msToTextChange = Audits.StatusView.minimumTextVisibilityDuration - msSinceLastChange; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 206 | |
| 207 | this._scheduledTextChangeTimeout = setTimeout(() => { |
| 208 | this._commitTextChange(text); |
| 209 | }, Math.max(msToTextChange, 0)); |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * @param {!Error} err |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 214 | */ |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 215 | renderBugReport(err) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 216 | console.error(err); |
| 217 | clearTimeout(this._scheduledFastFactTimeout); |
| 218 | clearTimeout(this._scheduledTextChangeTimeout); |
| 219 | this._resetProgressBarClasses(); |
| 220 | this._progressBar.classList.add('errored'); |
| 221 | |
| 222 | this._commitTextChange(''); |
Paul Irish | f265907 | 2019-03-24 19:08:52 +0000 | [diff] [blame] | 223 | this._statusText.createChild('p').createTextChild(Common.UIString('Ah, sorry! We ran into an error.')); |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 224 | if (Audits.StatusView.KnownBugPatterns.some(pattern => pattern.test(err.message))) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 225 | const message = Common.UIString( |
Lorne Mitchell | 7aa2c6c | 2019-04-03 03:50:10 +0000 | [diff] [blame] | 226 | 'Try to navigate to the URL in a fresh Chrome profile without any other tabs or extensions open and try again.'); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 227 | this._statusText.createChild('p').createTextChild(message); |
| 228 | } else { |
Paul Irish | f265907 | 2019-03-24 19:08:52 +0000 | [diff] [blame] | 229 | this._renderBugReportBody(err, this._inspectedURL); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 230 | } |
| 231 | } |
| 232 | |
| 233 | /** |
| 234 | * @param {!Error} err |
| 235 | * @param {string} auditURL |
| 236 | */ |
Paul Irish | f265907 | 2019-03-24 19:08:52 +0000 | [diff] [blame] | 237 | _renderBugReportBody(err, auditURL) { |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 238 | const issueBody = ` |
Paul Irish | f265907 | 2019-03-24 19:08:52 +0000 | [diff] [blame] | 239 | ${err.message} |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 240 | \`\`\` |
Paul Irish | f265907 | 2019-03-24 19:08:52 +0000 | [diff] [blame] | 241 | Channel: DevTools |
| 242 | Initial URL: ${auditURL} |
| 243 | Chrome Version: ${navigator.userAgent.match(/Chrome\/(\S+)/)[1]} |
| 244 | Stack Trace: ${err.stack} |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 245 | \`\`\` |
Paul Irish | f265907 | 2019-03-24 19:08:52 +0000 | [diff] [blame] | 246 | `; |
| 247 | this._statusText.createChild('p').createTextChild( |
| 248 | ls`If this issue is reproducible, please report it at the Lighthouse GitHub repo.`); |
| 249 | this._statusText.createChild('code', 'monospace').createTextChild(issueBody.trim()); |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 250 | } |
| 251 | }; |
| 252 | |
| 253 | |
| 254 | /** @type {!Array.<!RegExp>} */ |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 255 | Audits.StatusView.KnownBugPatterns = [ |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 256 | /PARSING_PROBLEM/, |
| 257 | /DOCUMENT_REQUEST/, |
| 258 | /READ_FAILED/, |
| 259 | /TRACING_ALREADY_STARTED/, |
| 260 | /^You must provide a url to the runner/, |
| 261 | /^You probably have multiple tabs open/, |
| 262 | ]; |
| 263 | |
| 264 | /** @typedef {{message: string, progressBarClass: string, order: number}} */ |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 265 | Audits.StatusView.StatusPhases = [ |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 266 | { |
| 267 | id: 'loading', |
| 268 | progressBarClass: 'loading', |
| 269 | statusMessagePrefix: 'Loading page', |
| 270 | order: 10, |
| 271 | }, |
| 272 | { |
| 273 | id: 'gathering', |
| 274 | progressBarClass: 'gathering', |
| 275 | message: 'Lighthouse is gathering information about the page to compute your score.', |
cjamcl@google.com | f2f8c09 | 2019-05-30 22:01:56 +0000 | [diff] [blame] | 276 | statusMessagePrefix: 'Gathering', |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 277 | order: 20, |
| 278 | }, |
| 279 | { |
| 280 | id: 'auditing', |
| 281 | progressBarClass: 'auditing', |
Paul Irish | 5726a18 | 2018-08-30 17:04:23 +0000 | [diff] [blame] | 282 | message: 'Almost there! Lighthouse is now generating your report.', |
cjamcl@google.com | f2f8c09 | 2019-05-30 22:01:56 +0000 | [diff] [blame] | 283 | statusMessagePrefix: 'Auditing', |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 284 | order: 30, |
| 285 | } |
| 286 | ]; |
| 287 | |
| 288 | /** @typedef {{message: string, deviceType: string, throttling: string}} */ |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 289 | Audits.StatusView.LoadingMessages = [ |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 290 | { |
| 291 | deviceType: 'mobile', |
| 292 | throttling: 'on', |
| 293 | message: 'Lighthouse is loading your page with throttling to measure performance on a mobile device on 3G.', |
| 294 | }, |
| 295 | { |
| 296 | deviceType: 'desktop', |
| 297 | throttling: 'on', |
| 298 | message: 'Lighthouse is loading your page with throttling to measure performance on a slow desktop on 3G.', |
| 299 | }, |
| 300 | { |
| 301 | deviceType: 'mobile', |
| 302 | throttling: 'off', |
| 303 | message: 'Lighthouse is loading your page with mobile emulation.', |
| 304 | }, |
| 305 | { |
| 306 | deviceType: 'desktop', |
| 307 | throttling: 'off', |
| 308 | message: 'Lighthouse is loading your page.', |
| 309 | }, |
| 310 | ]; |
| 311 | |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 312 | Audits.StatusView.FastFacts = [ |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 313 | '1MB takes a minimum of 5 seconds to download on a typical 3G connection [Source: WebPageTest and DevTools 3G definition].', |
| 314 | 'Rebuilding Pinterest pages for performance increased conversion rates by 15% [Source: WPO Stats]', |
| 315 | 'BBC has seen a loss of 10% of their users for every extra second of page load [Source: WPO Stats]', |
| 316 | 'By reducing the response size of JSON needed for displaying comments, Instagram saw increased impressions [Source: WPO Stats]', |
| 317 | 'Walmart saw a 1% increase in revenue for every 100ms improvement in page load [Source: WPO Stats]', |
| 318 | 'If a site takes >1 second to become interactive, users lose attention, and their perception of completing the page task is broken [Source: Google Developers Blog]', |
| 319 | '75% of global mobile users in 2016 were on 2G or 3G [Source: GSMA Mobile]', |
| 320 | 'The average user device costs less than 200 USD. [Source: International Data Corporation]', |
| 321 | '53% of all site visits are abandoned if page load takes more than 3 seconds [Source: Google DoubleClick blog]', |
| 322 | '19 seconds is the average time a mobile web page takes to load on a 3G connection [Source: Google DoubleClick blog]', |
| 323 | '14 seconds is the average time a mobile web page takes to load on a 4G connection [Source: Google DoubleClick blog]', |
| 324 | '70% of mobile pages take nearly 7 seconds for the visual content above the fold to display on the screen. [Source: Think with Google]', |
| 325 | 'As page load time increases from one second to seven seconds, the probability of a mobile site visitor bouncing increases 113%. [Source: Think with Google]', |
| 326 | 'As the number of elements on a page increases from 400 to 6,000, the probability of conversion drops 95%. [Source: Think with Google]', |
| 327 | '70% of mobile pages weigh over 1MB, 36% over 2MB, and 12% over 4MB. [Source: Think with Google]', |
| 328 | 'Lighthouse only simulates mobile performance; to measure performance on a real device, try WebPageTest.org [Source: Lighthouse team]', |
| 329 | ]; |
| 330 | |
| 331 | /** @const */ |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 332 | Audits.StatusView.fastFactRotationInterval = 6000; |
Blink Reformat | 4c46d09 | 2018-04-07 15:32:37 +0000 | [diff] [blame] | 333 | /** @const */ |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame^] | 334 | Audits.StatusView.minimumTextVisibilityDuration = 3000; |