lighthouse 11.7.0-dev.20240407 → 11.7.0-dev.20240409
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/test/smokehouse/config/exclusions.js +1 -0
- package/cli/test/smokehouse/core-tests.js +4 -0
- package/core/audits/redirects-http.d.ts +19 -0
- package/core/audits/redirects-http.js +75 -0
- package/core/computed/metrics/cumulative-layout-shift.js +2 -2
- package/core/computed/trace-engine-result.js +1 -1
- package/core/config/default-config.js +4 -7
- package/core/gather/driver/target-manager.js +1 -1
- package/core/gather/driver/wait-for-condition.js +2 -3
- package/core/gather/driver.js +1 -0
- package/core/gather/gatherers/trace-elements.d.ts +0 -10
- package/core/gather/gatherers/trace-elements.js +0 -19
- package/core/gather/session.d.ts +8 -0
- package/core/gather/session.js +12 -0
- package/core/runner.js +18 -23
- package/package.json +2 -2
- package/shared/localization/locales/ar-XB.json +0 -18
- package/shared/localization/locales/ar.json +0 -18
- package/shared/localization/locales/bg.json +0 -18
- package/shared/localization/locales/ca.json +0 -18
- package/shared/localization/locales/cs.json +0 -18
- package/shared/localization/locales/da.json +0 -18
- package/shared/localization/locales/de.json +0 -18
- package/shared/localization/locales/el.json +0 -18
- package/shared/localization/locales/en-GB.json +0 -18
- package/shared/localization/locales/en-US.json +9 -18
- package/shared/localization/locales/en-XA.json +0 -18
- package/shared/localization/locales/en-XL.json +9 -18
- package/shared/localization/locales/es-419.json +0 -18
- package/shared/localization/locales/es.json +0 -18
- package/shared/localization/locales/fi.json +0 -18
- package/shared/localization/locales/fil.json +0 -18
- package/shared/localization/locales/fr.json +0 -18
- package/shared/localization/locales/he.json +0 -18
- package/shared/localization/locales/hi.json +0 -18
- package/shared/localization/locales/hr.json +0 -18
- package/shared/localization/locales/hu.json +0 -18
- package/shared/localization/locales/id.json +0 -18
- package/shared/localization/locales/it.json +0 -18
- package/shared/localization/locales/ja.json +0 -18
- package/shared/localization/locales/ko.json +0 -18
- package/shared/localization/locales/lt.json +0 -18
- package/shared/localization/locales/lv.json +0 -18
- package/shared/localization/locales/nl.json +0 -18
- package/shared/localization/locales/no.json +0 -18
- package/shared/localization/locales/pl.json +0 -18
- package/shared/localization/locales/pt-PT.json +0 -18
- package/shared/localization/locales/pt.json +0 -18
- package/shared/localization/locales/ro.json +0 -18
- package/shared/localization/locales/ru.json +0 -18
- package/shared/localization/locales/sk.json +0 -18
- package/shared/localization/locales/sl.json +0 -18
- package/shared/localization/locales/sr-Latn.json +0 -18
- package/shared/localization/locales/sr.json +0 -18
- package/shared/localization/locales/sv.json +0 -18
- package/shared/localization/locales/ta.json +0 -18
- package/shared/localization/locales/te.json +0 -18
- package/shared/localization/locales/th.json +0 -18
- package/shared/localization/locales/tr.json +0 -18
- package/shared/localization/locales/uk.json +0 -18
- package/shared/localization/locales/vi.json +0 -18
- package/shared/localization/locales/zh-HK.json +0 -18
- package/shared/localization/locales/zh-TW.json +0 -18
- package/shared/localization/locales/zh.json +0 -18
- package/types/artifacts.d.ts +1 -13
- package/types/gatherer.d.ts +1 -0
- package/core/audits/layout-shift-elements.d.ts +0 -16
- package/core/audits/layout-shift-elements.js +0 -101
- package/core/audits/seo/plugins.d.ts +0 -15
- package/core/audits/seo/plugins.js +0 -150
- package/core/gather/gatherers/seo/embedded-content.d.ts +0 -10
- package/core/gather/gatherers/seo/embedded-content.js +0 -63
|
@@ -20,6 +20,7 @@ const exclusions = {
|
|
|
20
20
|
'redirects-client-paint-server', 'redirects-multiple-server',
|
|
21
21
|
'redirects-single-server', 'redirects-single-client',
|
|
22
22
|
'redirects-history-push-state', 'redirects-scripts',
|
|
23
|
+
'redirects-http',
|
|
23
24
|
// Disabled because these tests use settings that cannot be fully configured in
|
|
24
25
|
// DevTools (e.g. throttling method "provided").
|
|
25
26
|
'metrics-tricky-tti', 'metrics-tricky-tti-late-fcp', 'screenshot',
|
|
@@ -13,6 +13,7 @@ import dbw from './test-definitions/dobetterweb.js';
|
|
|
13
13
|
import errorsExpiredSsl from './test-definitions/errors-expired-ssl.js';
|
|
14
14
|
import errorsIframeExpiredSsl from './test-definitions/errors-iframe-expired-ssl.js';
|
|
15
15
|
import errorsInfiniteLoop from './test-definitions/errors-infinite-loop.js';
|
|
16
|
+
import fontSize from './test-definitions/font-size.js';
|
|
16
17
|
import formsAutoComplete from './test-definitions/forms-autocomplete.js';
|
|
17
18
|
import fpsMax from './test-definitions/fps-max.js';
|
|
18
19
|
import fpsMaxPassive from './test-definitions/fps-max-passive.js';
|
|
@@ -52,6 +53,7 @@ import pwaRocks from './test-definitions/pwa-rocks.js';
|
|
|
52
53
|
import pwaSvgomg from './test-definitions/pwa-svgomg.js';
|
|
53
54
|
import redirectsClientPaintServer from './test-definitions/redirects-client-paint-server.js';
|
|
54
55
|
import redirectsHistoryPushState from './test-definitions/redirects-history-push-state.js';
|
|
56
|
+
import redirectsHttp from './test-definitions/redirects-http.js';
|
|
55
57
|
import redirectsMultipleServer from './test-definitions/redirects-multiple-server.js';
|
|
56
58
|
import redirectsScripts from './test-definitions/redirects-scripts.js';
|
|
57
59
|
import redirectsSelf from './test-definitions/redirects-self.js';
|
|
@@ -77,6 +79,7 @@ const smokeTests = [
|
|
|
77
79
|
errorsExpiredSsl,
|
|
78
80
|
errorsIframeExpiredSsl,
|
|
79
81
|
errorsInfiniteLoop,
|
|
82
|
+
fontSize,
|
|
80
83
|
formsAutoComplete,
|
|
81
84
|
fpsMax,
|
|
82
85
|
fpsMaxPassive,
|
|
@@ -116,6 +119,7 @@ const smokeTests = [
|
|
|
116
119
|
pwaSvgomg,
|
|
117
120
|
redirectsClientPaintServer,
|
|
118
121
|
redirectsHistoryPushState,
|
|
122
|
+
redirectsHttp,
|
|
119
123
|
redirectsMultipleServer,
|
|
120
124
|
redirectsScripts,
|
|
121
125
|
redirectsSelf,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default RedirectsHTTP;
|
|
2
|
+
/**
|
|
3
|
+
* An audit for checking if a site starting on http redirects to https. The audit
|
|
4
|
+
* is marked not applicable if the requestedUrl is already https.
|
|
5
|
+
*/
|
|
6
|
+
declare class RedirectsHTTP extends Audit {
|
|
7
|
+
/**
|
|
8
|
+
* @param {LH.Artifacts} artifacts
|
|
9
|
+
* @return {LH.Audit.Product}
|
|
10
|
+
*/
|
|
11
|
+
static audit(artifacts: LH.Artifacts): LH.Audit.Product;
|
|
12
|
+
}
|
|
13
|
+
export namespace UIStrings {
|
|
14
|
+
const title: string;
|
|
15
|
+
const failureTitle: string;
|
|
16
|
+
const description: string;
|
|
17
|
+
}
|
|
18
|
+
import { Audit } from './audit.js';
|
|
19
|
+
//# sourceMappingURL=redirects-http.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2024 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {Audit} from './audit.js';
|
|
8
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
|
+
import UrlUtils from '../lib/url-utils.js';
|
|
10
|
+
|
|
11
|
+
const UIStrings = {
|
|
12
|
+
/** Title of a Lighthouse audit that provides detail on HTTP to HTTPS redirects. This descriptive title is shown to users when HTTP traffic is redirected to HTTPS. */
|
|
13
|
+
title: 'Redirects HTTP traffic to HTTPS',
|
|
14
|
+
/** Title of a Lighthouse audit that provides detail on HTTP to HTTPS redirects. This descriptive title is shown to users when HTTP traffic is not redirected to HTTPS. */
|
|
15
|
+
failureTitle: 'Does not redirect HTTP traffic to HTTPS',
|
|
16
|
+
/** Description of a Lighthouse audit that tells the user why they should direct HTTP traffic to HTTPS. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
|
|
17
|
+
description: 'Make sure that you redirect all HTTP ' +
|
|
18
|
+
'traffic to HTTPS in order to enable secure web features for all your users. [Learn more](https://developer.chrome.com/docs/lighthouse/pwa/redirects-http/).',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An audit for checking if a site starting on http redirects to https. The audit
|
|
25
|
+
* is marked not applicable if the requestedUrl is already https.
|
|
26
|
+
*/
|
|
27
|
+
class RedirectsHTTP extends Audit {
|
|
28
|
+
/**
|
|
29
|
+
* @return {LH.Audit.Meta}
|
|
30
|
+
*/
|
|
31
|
+
static get meta() {
|
|
32
|
+
return {
|
|
33
|
+
id: 'redirects-http',
|
|
34
|
+
title: str_(UIStrings.title),
|
|
35
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
36
|
+
description: str_(UIStrings.description),
|
|
37
|
+
requiredArtifacts: ['URL'],
|
|
38
|
+
supportedModes: ['navigation'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param {LH.Artifacts} artifacts
|
|
44
|
+
* @return {LH.Audit.Product}
|
|
45
|
+
*/
|
|
46
|
+
static audit(artifacts) {
|
|
47
|
+
if (!artifacts.URL.requestedUrl) {
|
|
48
|
+
throw new Error('Missing requestedUrl');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const requestedUrl = new URL(artifacts.URL.requestedUrl);
|
|
52
|
+
const finalDisplayedUrl = new URL(artifacts.URL.finalDisplayedUrl);
|
|
53
|
+
|
|
54
|
+
// Not applicable unless starting on http.
|
|
55
|
+
const startedInsecure = requestedUrl.protocol === 'http:';
|
|
56
|
+
|
|
57
|
+
// Relax requirements on localhost.
|
|
58
|
+
const isLocalhost = UrlUtils.isLikeLocalhost(finalDisplayedUrl.hostname);
|
|
59
|
+
|
|
60
|
+
if (!startedInsecure || isLocalhost) {
|
|
61
|
+
return {
|
|
62
|
+
score: null,
|
|
63
|
+
notApplicable: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const endedSecure = finalDisplayedUrl.protocol === 'https:';
|
|
68
|
+
return {
|
|
69
|
+
score: Number(endedSecure),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default RedirectsHTTP;
|
|
75
|
+
export {UIStrings};
|
|
@@ -163,10 +163,10 @@ class CumulativeLayoutShift {
|
|
|
163
163
|
await processor.parse(/** @type {import('@paulirish/trace_engine').Types.TraceEvents.TraceEventData[]} */ (
|
|
164
164
|
events
|
|
165
165
|
));
|
|
166
|
-
if (!processor.
|
|
166
|
+
if (!processor.traceParsedData) {
|
|
167
167
|
throw new Error('null trace engine result');
|
|
168
168
|
}
|
|
169
|
-
return processor.
|
|
169
|
+
return processor.traceParsedData.LayoutShifts.sessionMaxScore;
|
|
170
170
|
};
|
|
171
171
|
const cumulativeLayoutShift = await run(allFrameShiftEvents.map(e => e.event));
|
|
172
172
|
const cumulativeLayoutShiftMainFrame = await run(mainFrameShiftEvents.map(e => e.event));
|
|
@@ -133,7 +133,6 @@ const defaultConfig = {
|
|
|
133
133
|
{id: 'CSSUsage', gatherer: 'css-usage'},
|
|
134
134
|
{id: 'Doctype', gatherer: 'dobetterweb/doctype'},
|
|
135
135
|
{id: 'DOMStats', gatherer: 'dobetterweb/domstats'},
|
|
136
|
-
{id: 'EmbeddedContent', gatherer: 'seo/embedded-content'},
|
|
137
136
|
{id: 'FontSize', gatherer: 'seo/font-size'},
|
|
138
137
|
{id: 'Inputs', gatherer: 'inputs'},
|
|
139
138
|
{id: 'IFrameElements', gatherer: 'iframe-elements'},
|
|
@@ -169,6 +168,7 @@ const defaultConfig = {
|
|
|
169
168
|
],
|
|
170
169
|
audits: [
|
|
171
170
|
'is-on-https',
|
|
171
|
+
'redirects-http',
|
|
172
172
|
'viewport',
|
|
173
173
|
'metrics/first-contentful-paint',
|
|
174
174
|
'metrics/largest-contentful-paint',
|
|
@@ -212,7 +212,6 @@ const defaultConfig = {
|
|
|
212
212
|
'third-party-facades',
|
|
213
213
|
'largest-contentful-paint-element',
|
|
214
214
|
'lcp-lazy-loaded',
|
|
215
|
-
'layout-shift-elements',
|
|
216
215
|
'layout-shifts',
|
|
217
216
|
'long-tasks',
|
|
218
217
|
'non-composited-animations',
|
|
@@ -329,7 +328,6 @@ const defaultConfig = {
|
|
|
329
328
|
'seo/is-crawlable',
|
|
330
329
|
'seo/robots-txt',
|
|
331
330
|
'seo/hreflang',
|
|
332
|
-
'seo/plugins',
|
|
333
331
|
'seo/canonical',
|
|
334
332
|
'seo/manual/structured-data',
|
|
335
333
|
'work-during-interaction',
|
|
@@ -485,7 +483,6 @@ const defaultConfig = {
|
|
|
485
483
|
{id: 'final-screenshot', weight: 0, group: 'hidden'},
|
|
486
484
|
{id: 'script-treemap-data', weight: 0, group: 'hidden'},
|
|
487
485
|
{id: 'resource-summary', weight: 0, group: 'hidden'},
|
|
488
|
-
{id: 'layout-shift-elements', weight: 0, group: 'hidden'},
|
|
489
486
|
],
|
|
490
487
|
},
|
|
491
488
|
'accessibility': {
|
|
@@ -578,6 +575,7 @@ const defaultConfig = {
|
|
|
578
575
|
auditRefs: [
|
|
579
576
|
// Trust & Safety
|
|
580
577
|
{id: 'is-on-https', weight: 5, group: 'best-practices-trust-safety'},
|
|
578
|
+
{id: 'redirects-http', weight: 1, group: 'best-practices-trust-safety'},
|
|
581
579
|
{id: 'geolocation-on-start', weight: 1, group: 'best-practices-trust-safety'},
|
|
582
580
|
{id: 'notification-on-start', weight: 1, group: 'best-practices-trust-safety'},
|
|
583
581
|
{id: 'csp-xss', weight: 0, group: 'best-practices-trust-safety'},
|
|
@@ -585,6 +583,8 @@ const defaultConfig = {
|
|
|
585
583
|
{id: 'paste-preventing-inputs', weight: 3, group: 'best-practices-ux'},
|
|
586
584
|
{id: 'image-aspect-ratio', weight: 1, group: 'best-practices-ux'},
|
|
587
585
|
{id: 'image-size-responsive', weight: 1, group: 'best-practices-ux'},
|
|
586
|
+
{id: 'viewport', weight: 1, group: 'best-practices-ux'},
|
|
587
|
+
{id: 'font-size', weight: 1, group: 'best-practices-ux'},
|
|
588
588
|
// Browser Compatibility
|
|
589
589
|
{id: 'doctype', weight: 1, group: 'best-practices-browser-compat'},
|
|
590
590
|
{id: 'charset', weight: 1, group: 'best-practices-browser-compat'},
|
|
@@ -603,7 +603,6 @@ const defaultConfig = {
|
|
|
603
603
|
manualDescription: str_(UIStrings.seoCategoryManualDescription),
|
|
604
604
|
supportedModes: ['navigation', 'snapshot'],
|
|
605
605
|
auditRefs: [
|
|
606
|
-
{id: 'viewport', weight: 1, group: 'seo-mobile'},
|
|
607
606
|
{id: 'document-title', weight: 1, group: 'seo-content'},
|
|
608
607
|
{id: 'meta-description', weight: 1, group: 'seo-content'},
|
|
609
608
|
{id: 'http-status-code', weight: 1, group: 'seo-crawl'},
|
|
@@ -614,8 +613,6 @@ const defaultConfig = {
|
|
|
614
613
|
{id: 'image-alt', weight: 1, group: 'seo-content'},
|
|
615
614
|
{id: 'hreflang', weight: 1, group: 'seo-content'},
|
|
616
615
|
{id: 'canonical', weight: 1, group: 'seo-content'},
|
|
617
|
-
{id: 'font-size', weight: 1, group: 'seo-mobile'},
|
|
618
|
-
{id: 'plugins', weight: 1, group: 'seo-content'},
|
|
619
616
|
// Manual audits
|
|
620
617
|
{id: 'structured-data', weight: 0},
|
|
621
618
|
],
|
|
@@ -180,7 +180,7 @@ class TargetManager extends ProtocolEventEmitter {
|
|
|
180
180
|
throw err;
|
|
181
181
|
} finally {
|
|
182
182
|
// Resume the target if it was paused, but if it's unnecessary, we don't care about the error.
|
|
183
|
-
await newSession.
|
|
183
|
+
await newSession.sendCommandAndIgnore('Runtime.runIfWaitingForDebugger');
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -498,9 +498,8 @@ async function waitForFullyLoaded(session, networkMonitor, options) {
|
|
|
498
498
|
if (await isPageHung(session)) {
|
|
499
499
|
log.warn('waitFor', 'Page appears to be hung, killing JavaScript...');
|
|
500
500
|
// We don't await these, as we want to exit with PAGE_HUNG
|
|
501
|
-
void session.
|
|
502
|
-
|
|
503
|
-
void session.sendCommand('Runtime.terminateExecution').catch(_ => {});
|
|
501
|
+
void session.sendCommandAndIgnore('Emulation.setScriptExecutionDisabled', {value: true});
|
|
502
|
+
void session.sendCommandAndIgnore('Runtime.terminateExecution');
|
|
504
503
|
throw new LighthouseError(LighthouseError.errors.PAGE_HUNG);
|
|
505
504
|
}
|
|
506
505
|
|
package/core/gather/driver.js
CHANGED
|
@@ -9,16 +9,6 @@ export type TraceElementData = {
|
|
|
9
9
|
type?: string;
|
|
10
10
|
};
|
|
11
11
|
declare class TraceElements extends BaseGatherer {
|
|
12
|
-
/**
|
|
13
|
-
* This function finds the top (up to 15) elements that shift on the page.
|
|
14
|
-
*
|
|
15
|
-
* @param {LH.Trace} trace
|
|
16
|
-
* @param {LH.Gatherer.Context} context
|
|
17
|
-
* @return {Promise<Array<{nodeId: number}>>}
|
|
18
|
-
*/
|
|
19
|
-
static getTopLayoutShiftElements(trace: LH.Trace, context: LH.Gatherer.Context): Promise<Array<{
|
|
20
|
-
nodeId: number;
|
|
21
|
-
}>>;
|
|
22
12
|
/**
|
|
23
13
|
* We want to a single representative node to represent the shift, so let's pick
|
|
24
14
|
* the one with the largest impact (size x distance moved).
|
|
@@ -28,7 +28,6 @@ import {TraceEngineResult} from '../../computed/trace-engine-result.js';
|
|
|
28
28
|
|
|
29
29
|
/** @typedef {{nodeId: number, animations?: {name?: string, failureReasonsMask?: number, unsupportedProperties?: string[]}[], type?: string}} TraceElementData */
|
|
30
30
|
|
|
31
|
-
const MAX_LAYOUT_SHIFT_ELEMENTS = 15;
|
|
32
31
|
const MAX_LAYOUT_SHIFTS = 15;
|
|
33
32
|
|
|
34
33
|
/**
|
|
@@ -66,22 +65,6 @@ class TraceElements extends BaseGatherer {
|
|
|
66
65
|
if (name) this.animationIdToName.set(id, name);
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
/**
|
|
70
|
-
* This function finds the top (up to 15) elements that shift on the page.
|
|
71
|
-
*
|
|
72
|
-
* @param {LH.Trace} trace
|
|
73
|
-
* @param {LH.Gatherer.Context} context
|
|
74
|
-
* @return {Promise<Array<{nodeId: number}>>}
|
|
75
|
-
*/
|
|
76
|
-
static async getTopLayoutShiftElements(trace, context) {
|
|
77
|
-
const {impactByNodeId} = await CumulativeLayoutShift.request(trace, context);
|
|
78
|
-
|
|
79
|
-
return [...impactByNodeId.entries()]
|
|
80
|
-
.sort((a, b) => b[1] - a[1])
|
|
81
|
-
.slice(0, MAX_LAYOUT_SHIFT_ELEMENTS)
|
|
82
|
-
.map(([nodeId]) => ({nodeId}));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
68
|
/**
|
|
86
69
|
* We want to a single representative node to represent the shift, so let's pick
|
|
87
70
|
* the one with the largest impact (size x distance moved).
|
|
@@ -338,7 +321,6 @@ class TraceElements extends BaseGatherer {
|
|
|
338
321
|
const {mainThreadEvents} = processedTrace;
|
|
339
322
|
|
|
340
323
|
const lcpNodeData = await TraceElements.getLcpElement(trace, context);
|
|
341
|
-
const shiftElementsNodeData = await TraceElements.getTopLayoutShiftElements(trace, context);
|
|
342
324
|
const shiftsData = await TraceElements.getTopLayoutShifts(
|
|
343
325
|
trace, traceEngineResult, rootCauses, context);
|
|
344
326
|
const animatedElementData = await this.getAnimatedElements(mainThreadEvents);
|
|
@@ -347,7 +329,6 @@ class TraceElements extends BaseGatherer {
|
|
|
347
329
|
/** @type {Map<string, TraceElementData[]>} */
|
|
348
330
|
const backendNodeDataMap = new Map([
|
|
349
331
|
['largest-contentful-paint', lcpNodeData ? [lcpNodeData] : []],
|
|
350
|
-
['layout-shift-element', shiftElementsNodeData],
|
|
351
332
|
['layout-shift', shiftsData],
|
|
352
333
|
['animation', animatedElementData],
|
|
353
334
|
['responsiveness', responsivenessElementData ? [responsivenessElementData] : []],
|
package/core/gather/session.d.ts
CHANGED
|
@@ -40,6 +40,14 @@ export class ProtocolSession extends ProtocolSession_base implements LH.Gatherer
|
|
|
40
40
|
* @return {Promise<LH.CrdpCommands[C]['returnType']>}
|
|
41
41
|
*/
|
|
42
42
|
sendCommand<C extends keyof import("puppeteer-core").ProtocolMapping.Commands>(method: C, ...params: import("puppeteer-core").ProtocolMapping.Commands[C]["paramsType"]): Promise<import("puppeteer-core").ProtocolMapping.Commands[C]["returnType"]>;
|
|
43
|
+
/**
|
|
44
|
+
* Send and if there's an error response, do not reject.
|
|
45
|
+
* @template {keyof LH.CrdpCommands} C
|
|
46
|
+
* @param {C} method
|
|
47
|
+
* @param {LH.CrdpCommands[C]['paramsType']} params
|
|
48
|
+
* @return {Promise<void>}
|
|
49
|
+
*/
|
|
50
|
+
sendCommandAndIgnore<C_1 extends keyof import("puppeteer-core").ProtocolMapping.Commands>(method: C_1, ...params: import("puppeteer-core").ProtocolMapping.Commands[C_1]["paramsType"]): Promise<void>;
|
|
43
51
|
/**
|
|
44
52
|
* Disposes of a session so that it can no longer talk to Chrome.
|
|
45
53
|
* @return {Promise<void>}
|
package/core/gather/session.js
CHANGED
|
@@ -120,6 +120,18 @@ class ProtocolSession extends CrdpEventEmitter {
|
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Send and if there's an error response, do not reject.
|
|
125
|
+
* @template {keyof LH.CrdpCommands} C
|
|
126
|
+
* @param {C} method
|
|
127
|
+
* @param {LH.CrdpCommands[C]['paramsType']} params
|
|
128
|
+
* @return {Promise<void>}
|
|
129
|
+
*/
|
|
130
|
+
sendCommandAndIgnore(method, ...params) {
|
|
131
|
+
return this.sendCommand(method, ...params)
|
|
132
|
+
.catch(e => log.verbose('session', method, e.message)).then(_ => void 0);
|
|
133
|
+
}
|
|
134
|
+
|
|
123
135
|
/**
|
|
124
136
|
* Disposes of a session so that it can no longer talk to Chrome.
|
|
125
137
|
* @return {Promise<void>}
|
package/core/runner.js
CHANGED
|
@@ -199,32 +199,27 @@ class Runner {
|
|
|
199
199
|
data: sentryContext,
|
|
200
200
|
});
|
|
201
201
|
|
|
202
|
-
/** @type {LH.Artifacts} */
|
|
203
|
-
let artifacts;
|
|
204
202
|
if (settings.auditMode && !settings.gatherMode) {
|
|
205
203
|
// No browser required, just load the artifacts from disk.
|
|
206
204
|
const path = this._getDataSavePath(settings);
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const path = this._getDataSavePath(settings);
|
|
226
|
-
await assetSaver.saveArtifacts(artifacts, path);
|
|
227
|
-
}
|
|
205
|
+
return assetSaver.loadArtifacts(path);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const runnerStatus = {msg: 'Gather phase', id: 'lh:runner:gather'};
|
|
209
|
+
log.time(runnerStatus, 'verbose');
|
|
210
|
+
|
|
211
|
+
const artifacts = await gatherFn({resolvedConfig: options.resolvedConfig});
|
|
212
|
+
log.timeEnd(runnerStatus);
|
|
213
|
+
|
|
214
|
+
// If `gather` is run multiple times before `audit`, the timing entries for each `gather` can pollute one another.
|
|
215
|
+
// We need to clear the timing entries at the end of gathering.
|
|
216
|
+
// Set artifacts.Timing again to ensure lh:runner:gather is included.
|
|
217
|
+
artifacts.Timing = log.takeTimeEntries();
|
|
218
|
+
|
|
219
|
+
// -G means save these to disk (e.g. ./latest-run).
|
|
220
|
+
if (settings.gatherMode) {
|
|
221
|
+
const path = this._getDataSavePath(settings);
|
|
222
|
+
await assetSaver.saveArtifacts(artifacts, path);
|
|
228
223
|
}
|
|
229
224
|
|
|
230
225
|
return artifacts;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "11.7.0-dev.
|
|
4
|
+
"version": "11.7.0-dev.20240409",
|
|
5
5
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
6
6
|
"main": "./core/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"webtreemap-cdt": "^3.2.1"
|
|
180
180
|
},
|
|
181
181
|
"dependencies": {
|
|
182
|
-
"@paulirish/trace_engine": "^0.0.
|
|
182
|
+
"@paulirish/trace_engine": "^0.0.19",
|
|
183
183
|
"@sentry/node": "^6.17.4",
|
|
184
184
|
"axe-core": "^4.9.0",
|
|
185
185
|
"chrome-launcher": "^1.1.1",
|
|
@@ -1148,15 +1148,6 @@
|
|
|
1148
1148
|
"core/audits/largest-contentful-paint-element.js | title": {
|
|
1149
1149
|
"message": "Largest Contentful Paint element"
|
|
1150
1150
|
},
|
|
1151
|
-
"core/audits/layout-shift-elements.js | columnContribution": {
|
|
1152
|
-
"message": "Layout shift impact"
|
|
1153
|
-
},
|
|
1154
|
-
"core/audits/layout-shift-elements.js | description": {
|
|
1155
|
-
"message": "These DOM elements were most affected by layout shifts. Some layout shifts may not be included in the CLS metric value due to [windowing](https://web.dev/articles/cls#what_is_cls). [Learn how to improve CLS](https://web.dev/articles/optimize-cls)"
|
|
1156
|
-
},
|
|
1157
|
-
"core/audits/layout-shift-elements.js | title": {
|
|
1158
|
-
"message": "Avoid large layout shifts"
|
|
1159
|
-
},
|
|
1160
1151
|
"core/audits/layout-shifts.js | columnScore": {
|
|
1161
1152
|
"message": "Layout shift score"
|
|
1162
1153
|
},
|
|
@@ -1463,15 +1454,6 @@
|
|
|
1463
1454
|
"core/audits/seo/meta-description.js | title": {
|
|
1464
1455
|
"message": "Document has a meta description"
|
|
1465
1456
|
},
|
|
1466
|
-
"core/audits/seo/plugins.js | description": {
|
|
1467
|
-
"message": "Search engines can't index plugin content, and many devices restrict plugins or don't support them. [Learn more about avoiding plugins](https://developer.chrome.com/docs/lighthouse/seo/plugins/)."
|
|
1468
|
-
},
|
|
1469
|
-
"core/audits/seo/plugins.js | failureTitle": {
|
|
1470
|
-
"message": "Document uses plugins"
|
|
1471
|
-
},
|
|
1472
|
-
"core/audits/seo/plugins.js | title": {
|
|
1473
|
-
"message": "Document avoids plugins"
|
|
1474
|
-
},
|
|
1475
1457
|
"core/audits/seo/robots-txt.js | description": {
|
|
1476
1458
|
"message": "If your robots.txt file is malformed, crawlers may not be able to understand how you want your website to be crawled or indexed. [Learn more about robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)."
|
|
1477
1459
|
},
|
|
@@ -1148,15 +1148,6 @@
|
|
|
1148
1148
|
"core/audits/largest-contentful-paint-element.js | title": {
|
|
1149
1149
|
"message": "عنصر \"سرعة عرض أكبر جزء من المحتوى على الصفحة\""
|
|
1150
1150
|
},
|
|
1151
|
-
"core/audits/layout-shift-elements.js | columnContribution": {
|
|
1152
|
-
"message": "تأثير متغيّرات التصميم"
|
|
1153
|
-
},
|
|
1154
|
-
"core/audits/layout-shift-elements.js | description": {
|
|
1155
|
-
"message": "عناصر DOM هذه كانت الأكثر تأثّرًا بمتغيّرات التصميم. قد لا يتم تضمين بعض متغيّرات التصميم في قيمة مقياس متغيّرات التصميم التراكمية (CLS) بسبب [عملية الاستقطاع](https://web.dev/articles/cls#what_is_cls). [التعرُّف على كيفية تحسين متغيّرات التصميم التراكمية](https://web.dev/articles/optimize-cls)"
|
|
1156
|
-
},
|
|
1157
|
-
"core/audits/layout-shift-elements.js | title": {
|
|
1158
|
-
"message": "تجنُّب متغيّرات التصميم الكبيرة"
|
|
1159
|
-
},
|
|
1160
1151
|
"core/audits/layout-shifts.js | columnScore": {
|
|
1161
1152
|
"message": "نتيجة متغيّرات التصميم"
|
|
1162
1153
|
},
|
|
@@ -1463,15 +1454,6 @@
|
|
|
1463
1454
|
"core/audits/seo/meta-description.js | title": {
|
|
1464
1455
|
"message": "يحتوي المستند على وصف تعريفي"
|
|
1465
1456
|
},
|
|
1466
|
-
"core/audits/seo/plugins.js | description": {
|
|
1467
|
-
"message": "لا يمكن لمحركات البحث فهرسة محتوى مكوِّن إضافي، وتحظر العديد من الأجهزة استخدام المكوِّنات الإضافية أو لا تتوافق معها. [مزيد من المعلومات حول تجنُّب استخدام المكوِّنات الإضافية](https://developer.chrome.com/docs/lighthouse/seo/plugins/)"
|
|
1468
|
-
},
|
|
1469
|
-
"core/audits/seo/plugins.js | failureTitle": {
|
|
1470
|
-
"message": "يستخدم المستند مكونات إضافية"
|
|
1471
|
-
},
|
|
1472
|
-
"core/audits/seo/plugins.js | title": {
|
|
1473
|
-
"message": "يتجنّب المستند المكونات الإضافية"
|
|
1474
|
-
},
|
|
1475
1457
|
"core/audits/seo/robots-txt.js | description": {
|
|
1476
1458
|
"message": "في حال كان ملف robots.txt مكتوبًا بصيغة غير صحيحة، يمكن أن يتعذّر على برامج الزحف فهم الطريقة المطلوبة للزحف إلى موقعك الإلكتروني أو فهرسته. [مزيد من المعلومات حول ملف robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)"
|
|
1477
1459
|
},
|
|
@@ -1148,15 +1148,6 @@
|
|
|
1148
1148
|
"core/audits/largest-contentful-paint-element.js | title": {
|
|
1149
1149
|
"message": "Елемент, рендериран при изобразяване на най-голямото съдържание (LCP)"
|
|
1150
1150
|
},
|
|
1151
|
-
"core/audits/layout-shift-elements.js | columnContribution": {
|
|
1152
|
-
"message": "Въздействие на структурните промени"
|
|
1153
|
-
},
|
|
1154
|
-
"core/audits/layout-shift-elements.js | description": {
|
|
1155
|
-
"message": "Тези елементи на DOM са засегнати най-много от структурните промени. Някои структурни промени може да не са включени в стойността на показателя за CLS поради [рендериране на текущия прозорец](https://web.dev/articles/cls#what_is_cls). [Научете как да подобрите CLS](https://web.dev/articles/optimize-cls)"
|
|
1156
|
-
},
|
|
1157
|
-
"core/audits/layout-shift-elements.js | title": {
|
|
1158
|
-
"message": "Избягвайте големи промени в оформлението"
|
|
1159
|
-
},
|
|
1160
1151
|
"core/audits/layout-shifts.js | columnScore": {
|
|
1161
1152
|
"message": "Резултат за структурната промяна"
|
|
1162
1153
|
},
|
|
@@ -1463,15 +1454,6 @@
|
|
|
1463
1454
|
"core/audits/seo/meta-description.js | title": {
|
|
1464
1455
|
"message": "Документът има мета описание"
|
|
1465
1456
|
},
|
|
1466
|
-
"core/audits/seo/plugins.js | description": {
|
|
1467
|
-
"message": "Търсещите машини не могат да индексират съдържание с приставки. Много устройства ограничават приставките или не ги поддържат. [Научете повече за избягването на приставки](https://developer.chrome.com/docs/lighthouse/seo/plugins/)."
|
|
1468
|
-
},
|
|
1469
|
-
"core/audits/seo/plugins.js | failureTitle": {
|
|
1470
|
-
"message": "В документа се използват приставки"
|
|
1471
|
-
},
|
|
1472
|
-
"core/audits/seo/plugins.js | title": {
|
|
1473
|
-
"message": "Използването на приставки се избягва в документа"
|
|
1474
|
-
},
|
|
1475
1457
|
"core/audits/seo/robots-txt.js | description": {
|
|
1476
1458
|
"message": "Ако файлът ви robots.txt не е форматиран правилно, роботите може да не могат да разберат как искате да бъде обходен или индексиран уебсайтът ви. [Научете повече за robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)."
|
|
1477
1459
|
},
|
|
@@ -1148,15 +1148,6 @@
|
|
|
1148
1148
|
"core/audits/largest-contentful-paint-element.js | title": {
|
|
1149
1149
|
"message": "Element de renderització de l'element més gran amb contingut"
|
|
1150
1150
|
},
|
|
1151
|
-
"core/audits/layout-shift-elements.js | columnContribution": {
|
|
1152
|
-
"message": "Impacte del canvi de disseny"
|
|
1153
|
-
},
|
|
1154
|
-
"core/audits/layout-shift-elements.js | description": {
|
|
1155
|
-
"message": "Aquests són els elements de DOM que més s'han vist afectats pels canvis de disseny. És possible que alguns d'aquests canvis no s'incloguin al valor de la mètrica CLS a causa de la [normalització](https://web.dev/articles/cls#what_is_cls). [Informació sobre com pots millorar el CLS](https://web.dev/articles/optimize-cls)"
|
|
1156
|
-
},
|
|
1157
|
-
"core/audits/layout-shift-elements.js | title": {
|
|
1158
|
-
"message": "Evita els canvis de disseny importants"
|
|
1159
|
-
},
|
|
1160
1151
|
"core/audits/layout-shifts.js | columnScore": {
|
|
1161
1152
|
"message": "Puntuació del canvi de disseny"
|
|
1162
1153
|
},
|
|
@@ -1463,15 +1454,6 @@
|
|
|
1463
1454
|
"core/audits/seo/meta-description.js | title": {
|
|
1464
1455
|
"message": "El document té una metadescripció"
|
|
1465
1456
|
},
|
|
1466
|
-
"core/audits/seo/plugins.js | description": {
|
|
1467
|
-
"message": "Els motors de cerca no poden indexar el contingut dels connectors. A més, molts dispositius restringeixen o no admeten connectors. [Obtén més informació sobre com pots evitar els connectors](https://developer.chrome.com/docs/lighthouse/seo/plugins/)."
|
|
1468
|
-
},
|
|
1469
|
-
"core/audits/seo/plugins.js | failureTitle": {
|
|
1470
|
-
"message": "El document utilitza connectors"
|
|
1471
|
-
},
|
|
1472
|
-
"core/audits/seo/plugins.js | title": {
|
|
1473
|
-
"message": "El document evita els connectors"
|
|
1474
|
-
},
|
|
1475
1457
|
"core/audits/seo/robots-txt.js | description": {
|
|
1476
1458
|
"message": "Si el format del fitxer robots.txt no és correcte, és possible que els rastrejadors no puguin entendre com vols que rastregin o indexin el lloc web. [Obtén més informació sobre robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)."
|
|
1477
1459
|
},
|
|
@@ -1148,15 +1148,6 @@
|
|
|
1148
1148
|
"core/audits/largest-contentful-paint-element.js | title": {
|
|
1149
1149
|
"message": "Prvek Largest Contentful Paint"
|
|
1150
1150
|
},
|
|
1151
|
-
"core/audits/layout-shift-elements.js | columnContribution": {
|
|
1152
|
-
"message": "Dopad změny rozvržení"
|
|
1153
|
-
},
|
|
1154
|
-
"core/audits/layout-shift-elements.js | description": {
|
|
1155
|
-
"message": "Tyto prvky DOM byly změnami rozvržení ovlivněny nejvíce. Některé změny rozvržení do hodnoty metriky CLS vzhledem k [normalizaci ](https://web.dev/articles/cls#what_is_cls) nemusí zahrnuty. [Jak zlepšit CLS](https://web.dev/articles/optimize-cls)"
|
|
1156
|
-
},
|
|
1157
|
-
"core/audits/layout-shift-elements.js | title": {
|
|
1158
|
-
"message": "Zajistěte, aby nedocházelo k velkým změnám rozvržení"
|
|
1159
|
-
},
|
|
1160
1151
|
"core/audits/layout-shifts.js | columnScore": {
|
|
1161
1152
|
"message": "Skóre změny rozvržení"
|
|
1162
1153
|
},
|
|
@@ -1463,15 +1454,6 @@
|
|
|
1463
1454
|
"core/audits/seo/meta-description.js | title": {
|
|
1464
1455
|
"message": "Dokument má metaznačku „description“"
|
|
1465
1456
|
},
|
|
1466
|
-
"core/audits/seo/plugins.js | description": {
|
|
1467
|
-
"message": "Vyhledávače obsah pluginů nedokážou indexovat a na mnoha zařízeních jsou pluginy zakázány nebo nejsou podporovány. [Jak se vyhnout použití pluginů](https://developer.chrome.com/docs/lighthouse/seo/plugins/)"
|
|
1468
|
-
},
|
|
1469
|
-
"core/audits/seo/plugins.js | failureTitle": {
|
|
1470
|
-
"message": "Dokument používá pluginy"
|
|
1471
|
-
},
|
|
1472
|
-
"core/audits/seo/plugins.js | title": {
|
|
1473
|
-
"message": "V dokumentu nejsou použity pluginy"
|
|
1474
|
-
},
|
|
1475
1457
|
"core/audits/seo/robots-txt.js | description": {
|
|
1476
1458
|
"message": "Pokud soubor robots.txt nemá správný formát, prohledávače nemusejí být schopné zjistit, jak váš web mají procházet nebo indexovat. [Další informace o souboru robots.txt](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)"
|
|
1477
1459
|
},
|
|
@@ -1148,15 +1148,6 @@
|
|
|
1148
1148
|
"core/audits/largest-contentful-paint-element.js | title": {
|
|
1149
1149
|
"message": "Element med Largest Contentful Paint"
|
|
1150
1150
|
},
|
|
1151
|
-
"core/audits/layout-shift-elements.js | columnContribution": {
|
|
1152
|
-
"message": "Effekt af layoutskift"
|
|
1153
|
-
},
|
|
1154
|
-
"core/audits/layout-shift-elements.js | description": {
|
|
1155
|
-
"message": "Disse DOM-elementer blev mest påvirket af layoutskift. Nogle layoutskift medtages muligvis ikke i CLS-metricværdien som følge af [windowing](https://web.dev/articles/cls#what_is_cls). [Se, hvordan du forbedrer CLS](https://web.dev/articles/optimize-cls)"
|
|
1156
|
-
},
|
|
1157
|
-
"core/audits/layout-shift-elements.js | title": {
|
|
1158
|
-
"message": "Undgå store layoutskift"
|
|
1159
|
-
},
|
|
1160
1151
|
"core/audits/layout-shifts.js | columnScore": {
|
|
1161
1152
|
"message": "Resultat for layoutskift"
|
|
1162
1153
|
},
|
|
@@ -1463,15 +1454,6 @@
|
|
|
1463
1454
|
"core/audits/seo/meta-description.js | title": {
|
|
1464
1455
|
"message": "Dokumentet har en metabeskrivelse"
|
|
1465
1456
|
},
|
|
1466
|
-
"core/audits/seo/plugins.js | description": {
|
|
1467
|
-
"message": "Søgemaskiner kan ikke indeksere indhold i plugins, og mange enheder begrænser plugins eller understøtter dem ikke. [Få flere oplysninger om, hvordan du undgår plugins](https://developer.chrome.com/docs/lighthouse/seo/plugins/)."
|
|
1468
|
-
},
|
|
1469
|
-
"core/audits/seo/plugins.js | failureTitle": {
|
|
1470
|
-
"message": "Dokumentet bruger plugins"
|
|
1471
|
-
},
|
|
1472
|
-
"core/audits/seo/plugins.js | title": {
|
|
1473
|
-
"message": "Dokumentet undgår plugins"
|
|
1474
|
-
},
|
|
1475
1457
|
"core/audits/seo/robots-txt.js | description": {
|
|
1476
1458
|
"message": "Hvis din robots.txt-fil indeholder fejl, kan crawlere muligvis ikke forstå, hvordan du vil have dit website crawlet eller indekseret. [Få flere oplysninger om robots.txt.](https://developer.chrome.com/docs/lighthouse/seo/invalid-robots-txt/)"
|
|
1477
1459
|
},
|