lighthouse 11.7.0-dev.20240326 → 11.7.0-dev.20240327
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/core/audits/work-during-interaction.d.ts +2 -2
- package/core/audits/work-during-interaction.js +2 -2
- package/core/computed/metrics/lantern-metric.js +1 -3
- package/core/computed/metrics/metric.js +1 -3
- package/core/config/default-config.js +5 -9
- package/core/lib/lighthouse-compatibility.js +33 -0
- package/dist/report/bundle.esm.js +1 -1
- package/dist/report/flow.js +1 -1
- package/dist/report/standalone.js +1 -1
- package/package.json +1 -1
- package/report/renderer/report-utils.js +13 -10
- package/shared/localization/locales/ar-XB.json +1 -10
- package/shared/localization/locales/ar.json +1 -10
- package/shared/localization/locales/bg.json +1 -10
- package/shared/localization/locales/ca.json +1 -10
- package/shared/localization/locales/cs.json +1 -10
- package/shared/localization/locales/da.json +1 -10
- package/shared/localization/locales/de.json +1 -10
- package/shared/localization/locales/el.json +1 -10
- package/shared/localization/locales/en-GB.json +1 -10
- package/shared/localization/locales/en-US.json +2 -11
- package/shared/localization/locales/en-XA.json +1 -10
- package/shared/localization/locales/en-XL.json +2 -11
- package/shared/localization/locales/es-419.json +1 -10
- package/shared/localization/locales/es.json +1 -10
- package/shared/localization/locales/fi.json +1 -10
- package/shared/localization/locales/fil.json +1 -10
- package/shared/localization/locales/fr.json +1 -10
- package/shared/localization/locales/he.json +1 -10
- package/shared/localization/locales/hi.json +1 -10
- package/shared/localization/locales/hr.json +1 -10
- package/shared/localization/locales/hu.json +1 -10
- package/shared/localization/locales/id.json +1 -10
- package/shared/localization/locales/it.json +1 -10
- package/shared/localization/locales/ja.json +1 -10
- package/shared/localization/locales/ko.json +1 -10
- package/shared/localization/locales/lt.json +1 -10
- package/shared/localization/locales/lv.json +1 -10
- package/shared/localization/locales/nl.json +1 -10
- package/shared/localization/locales/no.json +1 -10
- package/shared/localization/locales/pl.json +1 -10
- package/shared/localization/locales/pt-PT.json +1 -10
- package/shared/localization/locales/pt.json +1 -10
- package/shared/localization/locales/ro.json +1 -10
- package/shared/localization/locales/ru.json +1 -10
- package/shared/localization/locales/sk.json +1 -10
- package/shared/localization/locales/sl.json +1 -10
- package/shared/localization/locales/sr-Latn.json +1 -10
- package/shared/localization/locales/sr.json +1 -10
- package/shared/localization/locales/sv.json +1 -10
- package/shared/localization/locales/ta.json +1 -10
- package/shared/localization/locales/te.json +1 -10
- package/shared/localization/locales/th.json +1 -10
- package/shared/localization/locales/tr.json +1 -10
- package/shared/localization/locales/uk.json +1 -10
- package/shared/localization/locales/vi.json +1 -10
- package/shared/localization/locales/zh-HK.json +1 -10
- package/shared/localization/locales/zh-TW.json +1 -10
- package/shared/localization/locales/zh.json +1 -10
- package/types/config.d.ts +0 -1
- package/types/lhr/lhr.d.ts +0 -2
- package/core/audits/no-unload-listeners.d.ts +0 -16
- package/core/audits/no-unload-listeners.js +0 -86
- package/core/config/metrics-to-audits.d.ts +0 -19
- package/core/config/metrics-to-audits.js +0 -60
- package/core/gather/gatherers/global-listeners.d.ts +0 -27
- package/core/gather/gatherers/global-listeners.js +0 -108
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export namespace metricsToAudits {
|
|
2
|
-
export { fcpRelevantAudits };
|
|
3
|
-
export { lcpRelevantAudits };
|
|
4
|
-
export { tbtRelevantAudits };
|
|
5
|
-
export { clsRelevantAudits };
|
|
6
|
-
export { inpRelevantAudits };
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @license
|
|
10
|
-
* Copyright 2021 Google LLC
|
|
11
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
12
|
-
*/
|
|
13
|
-
declare const fcpRelevantAudits: string[];
|
|
14
|
-
declare const lcpRelevantAudits: string[];
|
|
15
|
-
declare const tbtRelevantAudits: string[];
|
|
16
|
-
declare const clsRelevantAudits: string[];
|
|
17
|
-
declare const inpRelevantAudits: string[];
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=metrics-to-audits.d.ts.map
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2021 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// go/lh-audit-metric-mapping
|
|
8
|
-
const fcpRelevantAudits = [
|
|
9
|
-
'server-response-time',
|
|
10
|
-
'render-blocking-resources',
|
|
11
|
-
'redirects',
|
|
12
|
-
'critical-request-chains',
|
|
13
|
-
'uses-text-compression',
|
|
14
|
-
'uses-rel-preconnect',
|
|
15
|
-
'font-display',
|
|
16
|
-
'unminified-javascript',
|
|
17
|
-
'unminified-css',
|
|
18
|
-
'unused-css-rules',
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const lcpRelevantAudits = [
|
|
22
|
-
...fcpRelevantAudits,
|
|
23
|
-
'largest-contentful-paint-element',
|
|
24
|
-
'prioritize-lcp-image',
|
|
25
|
-
'unused-javascript',
|
|
26
|
-
'efficient-animated-content',
|
|
27
|
-
'total-byte-weight',
|
|
28
|
-
'lcp-lazy-loaded',
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
const tbtRelevantAudits = [
|
|
32
|
-
'long-tasks',
|
|
33
|
-
'third-party-summary',
|
|
34
|
-
'third-party-facades',
|
|
35
|
-
'bootup-time',
|
|
36
|
-
'mainthread-work-breakdown',
|
|
37
|
-
'dom-size',
|
|
38
|
-
'duplicated-javascript',
|
|
39
|
-
'legacy-javascript',
|
|
40
|
-
'viewport',
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
const clsRelevantAudits = [
|
|
44
|
-
'layout-shift-elements',
|
|
45
|
-
'layout-shifts',
|
|
46
|
-
'non-composited-animations',
|
|
47
|
-
'unsized-images',
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
const inpRelevantAudits = [
|
|
51
|
-
'work-during-interaction',
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
export const metricsToAudits = {
|
|
55
|
-
fcpRelevantAudits,
|
|
56
|
-
lcpRelevantAudits,
|
|
57
|
-
tbtRelevantAudits,
|
|
58
|
-
clsRelevantAudits,
|
|
59
|
-
inpRelevantAudits,
|
|
60
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default GlobalListeners;
|
|
2
|
-
declare class GlobalListeners extends BaseGatherer {
|
|
3
|
-
/**
|
|
4
|
-
* @param {LH.Crdp.DOMDebugger.EventListener} listener
|
|
5
|
-
* @return {listener is {type: 'pagehide'|'unload'|'visibilitychange'} & LH.Crdp.DOMDebugger.EventListener}
|
|
6
|
-
*/
|
|
7
|
-
static _filterForAllowlistedTypes(listener: LH.Crdp.DOMDebugger.EventListener): listener is {
|
|
8
|
-
type: 'pagehide' | 'unload' | 'visibilitychange';
|
|
9
|
-
} & import("devtools-protocol").Protocol.DOMDebugger.EventListener;
|
|
10
|
-
/**
|
|
11
|
-
* @param { LH.Artifacts.GlobalListener } listener
|
|
12
|
-
* @return { string }
|
|
13
|
-
*/
|
|
14
|
-
getListenerIndentifier(listener: LH.Artifacts.GlobalListener): string;
|
|
15
|
-
/**
|
|
16
|
-
* @param { LH.Artifacts['GlobalListeners'] } listeners
|
|
17
|
-
* @return { LH.Artifacts['GlobalListeners'] }
|
|
18
|
-
*/
|
|
19
|
-
dedupeListeners(listeners: LH.Artifacts['GlobalListeners']): LH.Artifacts['GlobalListeners'];
|
|
20
|
-
/**
|
|
21
|
-
* @param {LH.Gatherer.Context} passContext
|
|
22
|
-
* @return {Promise<LH.Artifacts['GlobalListeners']>}
|
|
23
|
-
*/
|
|
24
|
-
getArtifact(passContext: LH.Gatherer.Context): Promise<LH.Artifacts['GlobalListeners']>;
|
|
25
|
-
}
|
|
26
|
-
import BaseGatherer from '../base-gatherer.js';
|
|
27
|
-
//# sourceMappingURL=global-listeners.d.ts.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @fileoverview
|
|
9
|
-
* A gatherer to collect information about the event listeners registered on the
|
|
10
|
-
* global object. For now, the scope is narrowed to events that occur on and
|
|
11
|
-
* around page unload, but this can be expanded in the future.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import log from 'lighthouse-logger';
|
|
15
|
-
|
|
16
|
-
import BaseGatherer from '../base-gatherer.js';
|
|
17
|
-
|
|
18
|
-
class GlobalListeners extends BaseGatherer {
|
|
19
|
-
/** @type {LH.Gatherer.GathererMeta} */
|
|
20
|
-
meta = {
|
|
21
|
-
supportedModes: ['snapshot', 'timespan', 'navigation'],
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @param {LH.Crdp.DOMDebugger.EventListener} listener
|
|
26
|
-
* @return {listener is {type: 'pagehide'|'unload'|'visibilitychange'} & LH.Crdp.DOMDebugger.EventListener}
|
|
27
|
-
*/
|
|
28
|
-
static _filterForAllowlistedTypes(listener) {
|
|
29
|
-
return listener.type === 'pagehide' ||
|
|
30
|
-
listener.type === 'unload' ||
|
|
31
|
-
listener.type === 'visibilitychange';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @param { LH.Artifacts.GlobalListener } listener
|
|
36
|
-
* @return { string }
|
|
37
|
-
*/
|
|
38
|
-
getListenerIndentifier(listener) {
|
|
39
|
-
return `${listener.type}:${listener.scriptId}:${listener.columnNumber}:${listener.lineNumber}`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @param { LH.Artifacts['GlobalListeners'] } listeners
|
|
44
|
-
* @return { LH.Artifacts['GlobalListeners'] }
|
|
45
|
-
*/
|
|
46
|
-
dedupeListeners(listeners) {
|
|
47
|
-
const seenListeners = new Set();
|
|
48
|
-
return listeners.filter(listener => {
|
|
49
|
-
const id = this.getListenerIndentifier(listener);
|
|
50
|
-
if (!seenListeners.has(id)) {
|
|
51
|
-
seenListeners.add(id);
|
|
52
|
-
return true;
|
|
53
|
-
} else {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @param {LH.Gatherer.Context} passContext
|
|
61
|
-
* @return {Promise<LH.Artifacts['GlobalListeners']>}
|
|
62
|
-
*/
|
|
63
|
-
async getArtifact(passContext) {
|
|
64
|
-
const session = passContext.driver.defaultSession;
|
|
65
|
-
|
|
66
|
-
/** @type {Array<LH.Artifacts.GlobalListener>} */
|
|
67
|
-
const listeners = [];
|
|
68
|
-
|
|
69
|
-
for (const executionContext of passContext.driver.targetManager.mainFrameExecutionContexts()) {
|
|
70
|
-
// Get a RemoteObject handle to `window`.
|
|
71
|
-
let objectId;
|
|
72
|
-
try {
|
|
73
|
-
const {result} = await session.sendCommand('Runtime.evaluate', {
|
|
74
|
-
expression: 'window',
|
|
75
|
-
returnByValue: false,
|
|
76
|
-
uniqueContextId: executionContext.uniqueId,
|
|
77
|
-
});
|
|
78
|
-
if (!result.objectId) {
|
|
79
|
-
throw new Error('Error fetching information about the global object');
|
|
80
|
-
}
|
|
81
|
-
objectId = result.objectId;
|
|
82
|
-
} catch (err) {
|
|
83
|
-
// Execution context is no longer valid, but don't let that fail the gatherer.
|
|
84
|
-
log.warn('Execution context is no longer valid', executionContext, err);
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// And get all its listeners of interest.
|
|
89
|
-
const response = await session.sendCommand('DOMDebugger.getEventListeners', {objectId});
|
|
90
|
-
for (const listener of response.listeners) {
|
|
91
|
-
if (GlobalListeners._filterForAllowlistedTypes(listener)) {
|
|
92
|
-
const {type, scriptId, lineNumber, columnNumber} = listener;
|
|
93
|
-
listeners.push({
|
|
94
|
-
type,
|
|
95
|
-
scriptId,
|
|
96
|
-
lineNumber,
|
|
97
|
-
columnNumber,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Dedupe listeners with same underlying data.
|
|
104
|
-
return this.dedupeListeners(listeners);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export default GlobalListeners;
|