lighthouse 11.6.0-dev.20240221 → 11.6.0-dev.20240223
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.
|
@@ -12,6 +12,10 @@ declare class DevtoolsLog extends BaseGatherer {
|
|
|
12
12
|
* @param {LH.Gatherer.Context} passContext
|
|
13
13
|
*/
|
|
14
14
|
stopSensitiveInstrumentation({ driver }: LH.Gatherer.Context): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* @return {LH.Artifacts['DevtoolsLog']}
|
|
17
|
+
*/
|
|
18
|
+
getDebugData(): LH.Artifacts['DevtoolsLog'];
|
|
15
19
|
/**
|
|
16
20
|
* @return {Promise<LH.Artifacts['DevtoolsLog']>}
|
|
17
21
|
*/
|
|
@@ -49,6 +49,13 @@ class DevtoolsLog extends BaseGatherer {
|
|
|
49
49
|
driver.targetManager.off('protocolevent', this._onProtocolMessage);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* @return {LH.Artifacts['DevtoolsLog']}
|
|
54
|
+
*/
|
|
55
|
+
getDebugData() {
|
|
56
|
+
return this._messageLog.messages;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
/**
|
|
53
60
|
* @return {Promise<LH.Artifacts['DevtoolsLog']>}
|
|
54
61
|
*/
|
|
@@ -17,6 +17,7 @@ declare class Trace extends BaseGatherer {
|
|
|
17
17
|
* @param {LH.Gatherer.Context} passContext
|
|
18
18
|
*/
|
|
19
19
|
stopSensitiveInstrumentation({ driver }: LH.Gatherer.Context): Promise<void>;
|
|
20
|
+
getDebugData(): import("../../index.js").Trace;
|
|
20
21
|
getArtifact(): import("../../index.js").Trace;
|
|
21
22
|
}
|
|
22
23
|
import BaseGatherer from '../base-gatherer.js';
|
|
@@ -110,32 +110,20 @@ async function _navigate(navigationContext) {
|
|
|
110
110
|
* @return {Promise<{devtoolsLog?: LH.DevtoolsLog, records?: Array<LH.Artifacts.NetworkRequest>, trace?: LH.Trace}>}
|
|
111
111
|
*/
|
|
112
112
|
async function _collectDebugData(navigationContext, phaseState) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
*/
|
|
125
|
-
defn => Boolean(defn)
|
|
126
|
-
);
|
|
127
|
-
if (!artifactDefinitions.length) return {};
|
|
128
|
-
|
|
129
|
-
await collectPhaseArtifacts({...phaseState, phase: 'getArtifact', artifactDefinitions});
|
|
130
|
-
const getArtifactState = phaseState.artifactState.getArtifact;
|
|
113
|
+
let devtoolsLog;
|
|
114
|
+
let trace;
|
|
115
|
+
|
|
116
|
+
for (const definition of phaseState.artifactDefinitions) {
|
|
117
|
+
const {instance} = definition.gatherer;
|
|
118
|
+
if (instance instanceof DevtoolsLog) {
|
|
119
|
+
devtoolsLog = instance.getDebugData();
|
|
120
|
+
} else if (instance instanceof Trace) {
|
|
121
|
+
trace = instance.getDebugData();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
131
124
|
|
|
132
|
-
const devtoolsLogArtifactId = devtoolsLogArtifactDefn?.id;
|
|
133
|
-
const devtoolsLog = devtoolsLogArtifactId && (await getArtifactState[devtoolsLogArtifactId]);
|
|
134
125
|
const records = devtoolsLog && (await NetworkRecords.request(devtoolsLog, navigationContext));
|
|
135
126
|
|
|
136
|
-
const traceArtifactId = traceArtifactDefn?.id;
|
|
137
|
-
const trace = traceArtifactId && (await getArtifactState[traceArtifactId]);
|
|
138
|
-
|
|
139
127
|
return {devtoolsLog, records, trace};
|
|
140
128
|
}
|
|
141
129
|
|
package/package.json
CHANGED