lighthouse 10.0.2-dev.20230314 → 10.0.2-dev.20230316
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.
|
@@ -28,6 +28,11 @@ declare class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
28
28
|
*/
|
|
29
29
|
static buildPolyfillExpression(object: string | null, property: string): string;
|
|
30
30
|
static getPolyfillData(): {
|
|
31
|
+
name: string;
|
|
32
|
+
modules: string[];
|
|
33
|
+
corejs?: boolean | undefined;
|
|
34
|
+
}[];
|
|
35
|
+
static getCoreJsPolyfillData(): {
|
|
31
36
|
name: string;
|
|
32
37
|
coreJs2Module: string;
|
|
33
38
|
coreJs3Module: string;
|
|
@@ -177,7 +177,12 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
static getPolyfillData() {
|
|
180
|
-
|
|
180
|
+
/** @type {Array<{name: string, modules: string[], corejs?: boolean}>} */
|
|
181
|
+
const data = [
|
|
182
|
+
{name: 'focus-visible', modules: ['focus-visible']},
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
const coreJsPolyfills = [
|
|
181
186
|
['Array.prototype.fill', 'es6.array.fill'],
|
|
182
187
|
['Array.prototype.filter', 'es6.array.filter'],
|
|
183
188
|
['Array.prototype.find', 'es6.array.find'],
|
|
@@ -225,15 +230,32 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
225
230
|
['Object.entries', 'es7.object.entries'],
|
|
226
231
|
['Object.getOwnPropertyDescriptors', 'es7.object.get-own-property-descriptors'],
|
|
227
232
|
['Object.values', 'es7.object.values'],
|
|
228
|
-
]
|
|
229
|
-
|
|
230
|
-
|
|
233
|
+
];
|
|
234
|
+
|
|
235
|
+
for (const [name, coreJs2Module] of coreJsPolyfills) {
|
|
236
|
+
data.push({
|
|
231
237
|
name,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
238
|
+
modules: [
|
|
239
|
+
coreJs2Module,
|
|
240
|
+
// corejs 3 module name
|
|
241
|
+
coreJs2Module
|
|
242
|
+
.replace('es6.', 'es.')
|
|
243
|
+
.replace('es7.', 'es.')
|
|
244
|
+
.replace('typed.', 'typed-array.'),
|
|
245
|
+
],
|
|
246
|
+
corejs: true,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return data;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
static getCoreJsPolyfillData() {
|
|
254
|
+
return this.getPolyfillData().filter(d => d.corejs).map(d => {
|
|
255
|
+
return {
|
|
256
|
+
name: d.name,
|
|
257
|
+
coreJs2Module: d.modules[0],
|
|
258
|
+
coreJs3Module: d.modules[1],
|
|
237
259
|
};
|
|
238
260
|
});
|
|
239
261
|
}
|
|
@@ -242,15 +264,20 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
242
264
|
* @return {Pattern[]}
|
|
243
265
|
*/
|
|
244
266
|
static getPolyfillPatterns() {
|
|
245
|
-
|
|
267
|
+
/** @type {Pattern[]} */
|
|
268
|
+
const patterns = [];
|
|
269
|
+
|
|
270
|
+
for (const {name} of this.getCoreJsPolyfillData()) {
|
|
246
271
|
const parts = name.split('.');
|
|
247
272
|
const object = parts.length > 1 ? parts.slice(0, parts.length - 1).join('.') : null;
|
|
248
273
|
const property = parts[parts.length - 1];
|
|
249
|
-
|
|
274
|
+
patterns.push({
|
|
250
275
|
name,
|
|
251
276
|
expression: this.buildPolyfillExpression(object, property),
|
|
252
|
-
};
|
|
253
|
-
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return patterns;
|
|
254
281
|
}
|
|
255
282
|
|
|
256
283
|
/**
|
|
@@ -301,12 +328,12 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
301
328
|
// If it's a bundle with source maps, add in the polyfill modules by name too.
|
|
302
329
|
const bundle = bundles.find(b => b.script.scriptId === script.scriptId);
|
|
303
330
|
if (bundle) {
|
|
304
|
-
for (const {
|
|
331
|
+
for (const {name, modules} of polyfillData) {
|
|
305
332
|
// Skip if the pattern matching found a match for this polyfill.
|
|
306
333
|
if (matches.some(m => m.name === name)) continue;
|
|
307
334
|
|
|
308
335
|
const source = bundle.rawMap.sources.find(source =>
|
|
309
|
-
|
|
336
|
+
modules.some(module => source.endsWith(`${module}.js`)));
|
|
310
337
|
if (!source) continue;
|
|
311
338
|
|
|
312
339
|
const mapping = bundle.map.mappings().find(m => m.sourceURL === source);
|
|
@@ -344,7 +371,6 @@ class LegacyJavascript extends ByteEfficiencyAudit {
|
|
|
344
371
|
}
|
|
345
372
|
}
|
|
346
373
|
|
|
347
|
-
if (polyfillResults.length > 0) estimatedWastedBytesFromPolyfills += graph.baseSize;
|
|
348
374
|
estimatedWastedBytesFromPolyfills += [...modulesSeen].reduce((acc, moduleIndex) => {
|
|
349
375
|
return acc + graph.moduleSizes[moduleIndex];
|
|
350
376
|
}, 0);
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
"moduleSizes": [498, 265, 277, 263, 453, 219, 216, 546, 339, 1608, 671, 1525, 420, 214, 504, 98, 524, 196, 268, 642, 204, 742, 618, 169, 394, 127, 433, 1473, 779, 239, 144, 182, 254, 77, 508, 124, 1388, 75, 133, 301, 362, 170, 1078, 182, 490, 195, 321, 316, 447, 551, 216, 284, 253, 17, 107, 295, 356, 345, 1939, 1596, 291, 139, 259, 1291, 179, 528, 174, 61, 326, 20, 444, 522, 104, 1945, 120, 1943, 680, 1409, 850, 630, 288, 38, 695, 569, 106, 587, 208, 370, 606, 766, 535, 616, 200, 170, 224, 422, 970, 978, 498, 284, 241, 210, 151, 194, 178, 814, 205, 189, 215, 111, 236, 147, 237, 191, 691, 212, 432, 499, 445, 176, 333, 129, 414, 617, 380, 251, 199, 524, 515, 681, 160, 259, 295, 283, 178, 472, 786, 520, 202, 575, 575, 349, 549, 458, 166, 173, 508, 1522, 743, 414, 431, 393, 899, 137, 270, 131, 472, 457, 205, 778, 801, 133],
|
|
2
|
+
"moduleSizes": [11897, 498, 265, 277, 263, 453, 219, 216, 546, 339, 1608, 671, 1525, 420, 214, 504, 98, 524, 196, 268, 642, 204, 742, 618, 169, 394, 127, 433, 1473, 779, 239, 144, 182, 254, 77, 508, 124, 1388, 75, 133, 301, 362, 170, 1078, 182, 490, 195, 321, 316, 447, 551, 216, 284, 253, 17, 107, 295, 356, 345, 1939, 1596, 291, 139, 259, 1291, 179, 528, 174, 61, 326, 20, 444, 522, 104, 1945, 120, 1943, 680, 1409, 850, 630, 288, 38, 695, 569, 106, 587, 208, 370, 606, 766, 535, 616, 200, 170, 224, 422, 970, 978, 498, 284, 241, 210, 151, 194, 178, 814, 205, 189, 215, 111, 236, 147, 237, 191, 691, 212, 432, 499, 445, 176, 333, 129, 414, 617, 380, 251, 199, 524, 515, 681, 160, 259, 295, 283, 178, 472, 786, 520, 202, 575, 575, 349, 549, 458, 166, 173, 508, 1522, 743, 414, 431, 393, 899, 137, 270, 131, 472, 457, 205, 778, 801, 133, 3000],
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"Array.prototype.fill": [
|
|
5
|
-
"Array.prototype.filter": [
|
|
6
|
-
"Array.prototype.find": [
|
|
7
|
-
"Array.prototype.findIndex": [
|
|
8
|
-
"Array.prototype.forEach": [
|
|
9
|
-
"Array.from": [
|
|
10
|
-
"Array.isArray": [
|
|
11
|
-
"Array.prototype.map": [
|
|
12
|
-
"Array.of": [
|
|
13
|
-
"Array.prototype.some": [
|
|
14
|
-
"Date.now": [
|
|
15
|
-
"Date.prototype.toISOString": [
|
|
16
|
-
"Date.prototype.toJSON": [
|
|
17
|
-
"Date.prototype.toString": [
|
|
18
|
-
"Function.prototype.name": [
|
|
19
|
-
"Number.isInteger": [
|
|
20
|
-
"Number.isSafeInteger": [
|
|
21
|
-
"Object.defineProperties": [
|
|
22
|
-
"Object.defineProperty": [
|
|
23
|
-
"Object.freeze": [
|
|
24
|
-
"Object.getPrototypeOf": [
|
|
25
|
-
"Object.isExtensible": [
|
|
26
|
-
"Object.isFrozen": [
|
|
27
|
-
"Object.isSealed": [
|
|
28
|
-
"Object.keys": [
|
|
29
|
-
"Object.preventExtensions": [
|
|
30
|
-
"Object.seal": [
|
|
31
|
-
"Object.setPrototypeOf": [
|
|
32
|
-
"Reflect.apply": [
|
|
33
|
-
"Reflect.construct": [
|
|
34
|
-
"Reflect.defineProperty": [
|
|
35
|
-
"Reflect.deleteProperty": [
|
|
36
|
-
"Reflect.get": [
|
|
37
|
-
"Reflect.getOwnPropertyDescriptor": [
|
|
38
|
-
"Reflect.getPrototypeOf": [
|
|
39
|
-
"Reflect.has": [
|
|
40
|
-
"Reflect.isExtensible": [
|
|
41
|
-
"Reflect.ownKeys": [
|
|
42
|
-
"Reflect.preventExtensions": [
|
|
43
|
-
"Reflect.setPrototypeOf": [
|
|
44
|
-
"String.prototype.codePointAt": [
|
|
45
|
-
"String.fromCodePoint": [
|
|
46
|
-
"String.raw": [
|
|
47
|
-
"String.prototype.repeat": [
|
|
48
|
-
"Object.entries": [
|
|
49
|
-
"Object.getOwnPropertyDescriptors": [
|
|
50
|
-
"Object.values": [
|
|
4
|
+
"Array.prototype.fill": [0, 5, 8, 11, 21, 23, 25, 26, 29, 36, 37, 54, 55, 57, 58, 60, 66, 73, 74, 75, 76, 77, 79, 81, 82, 86, 87, 88, 92, 94, 101, 102, 103, 104, 114, 116],
|
|
5
|
+
"Array.prototype.filter": [0, 11, 12, 13, 17, 18, 21, 22, 23, 25, 26, 29, 36, 37, 41, 46, 54, 57, 58, 60, 62, 64, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 108, 114, 117],
|
|
6
|
+
"Array.prototype.find": [0, 5, 11, 12, 17, 18, 21, 22, 23, 25, 26, 29, 36, 37, 41, 46, 54, 55, 57, 58, 60, 62, 64, 66, 73, 74, 75, 76, 77, 79, 81, 82, 86, 87, 88, 92, 94, 101, 102, 103, 104, 108, 114, 119],
|
|
7
|
+
"Array.prototype.findIndex": [0, 5, 11, 12, 17, 18, 21, 22, 23, 25, 26, 29, 36, 37, 41, 46, 54, 55, 57, 58, 60, 62, 64, 66, 73, 74, 75, 76, 77, 79, 81, 82, 86, 87, 88, 92, 94, 101, 102, 103, 104, 108, 114, 118],
|
|
8
|
+
"Array.prototype.forEach": [0, 9, 11, 12, 14, 17, 18, 21, 22, 23, 25, 26, 29, 36, 37, 41, 46, 54, 57, 58, 60, 62, 64, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 108, 114, 120],
|
|
9
|
+
"Array.from": [0, 10, 11, 19, 20, 21, 22, 23, 25, 26, 27, 29, 36, 37, 41, 46, 49, 50, 54, 57, 58, 60, 61, 64, 66, 72, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 108, 114, 121],
|
|
10
|
+
"Array.isArray": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 62, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 122],
|
|
11
|
+
"Array.prototype.map": [0, 11, 12, 13, 17, 18, 21, 22, 23, 25, 26, 29, 36, 37, 41, 46, 54, 57, 58, 60, 62, 64, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 108, 114, 123],
|
|
12
|
+
"Array.of": [0, 11, 21, 22, 23, 25, 26, 27, 29, 36, 37, 54, 57, 58, 60, 64, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 108, 114, 124],
|
|
13
|
+
"Array.prototype.some": [0, 11, 12, 14, 17, 18, 21, 22, 23, 25, 26, 29, 36, 37, 41, 46, 54, 57, 58, 60, 62, 64, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 108, 114, 125],
|
|
14
|
+
"Date.now": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 126],
|
|
15
|
+
"Date.prototype.toISOString": [0, 11, 21, 22, 23, 25, 26, 28, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 98, 99, 101, 102, 103, 104, 108, 109, 114, 127],
|
|
16
|
+
"Date.prototype.toJSON": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 128],
|
|
17
|
+
"Date.prototype.toString": [0, 25, 26, 29, 54, 58, 60, 74, 94, 114, 129],
|
|
18
|
+
"Function.prototype.name": [0, 130],
|
|
19
|
+
"Number.isInteger": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 67, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 131],
|
|
20
|
+
"Number.isSafeInteger": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 67, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 132],
|
|
21
|
+
"Object.defineProperties": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 77, 79, 81, 82, 86, 87, 88, 92, 94, 101, 102, 103, 104, 114, 133],
|
|
22
|
+
"Object.defineProperty": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 134],
|
|
23
|
+
"Object.freeze": [0, 7, 11, 15, 21, 23, 25, 26, 27, 29, 36, 37, 39, 54, 57, 58, 59, 60, 66, 73, 74, 75, 79, 80, 81, 82, 84, 86, 88, 92, 94, 101, 102, 103, 104, 114, 136],
|
|
24
|
+
"Object.getPrototypeOf": [0, 11, 21, 23, 24, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 83, 86, 88, 92, 94, 101, 102, 103, 104, 114, 138],
|
|
25
|
+
"Object.isExtensible": [0, 7, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 84, 86, 88, 92, 94, 101, 102, 103, 104, 114, 139],
|
|
26
|
+
"Object.isFrozen": [0, 7, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 140],
|
|
27
|
+
"Object.isSealed": [0, 7, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 141],
|
|
28
|
+
"Object.keys": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 87, 88, 92, 94, 101, 102, 103, 104, 114, 142],
|
|
29
|
+
"Object.preventExtensions": [0, 7, 11, 15, 21, 23, 25, 26, 27, 29, 36, 37, 39, 54, 57, 58, 59, 60, 66, 73, 74, 75, 79, 80, 81, 82, 84, 86, 88, 92, 94, 101, 102, 103, 104, 114, 143],
|
|
30
|
+
"Object.seal": [0, 7, 11, 15, 21, 23, 25, 26, 27, 29, 36, 37, 39, 54, 57, 58, 59, 60, 66, 73, 74, 75, 79, 80, 81, 82, 84, 86, 88, 92, 94, 101, 102, 103, 104, 114, 144],
|
|
31
|
+
"Object.setPrototypeOf": [0, 4, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 89, 92, 94, 101, 102, 103, 104, 114, 145],
|
|
32
|
+
"Reflect.apply": [0, 11, 21, 23, 25, 26, 29, 36, 37, 40, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 147],
|
|
33
|
+
"Reflect.construct": [0, 3, 11, 16, 21, 22, 23, 25, 26, 29, 36, 37, 40, 43, 54, 55, 57, 58, 60, 64, 66, 73, 74, 75, 76, 77, 79, 81, 82, 86, 87, 88, 92, 94, 101, 102, 103, 104, 108, 114, 148],
|
|
34
|
+
"Reflect.defineProperty": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 149],
|
|
35
|
+
"Reflect.deleteProperty": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 150],
|
|
36
|
+
"Reflect.get": [0, 11, 21, 23, 24, 25, 26, 29, 36, 37, 54, 57, 58, 60, 65, 66, 73, 74, 75, 79, 81, 82, 83, 86, 88, 92, 94, 101, 102, 103, 104, 114, 153],
|
|
37
|
+
"Reflect.getOwnPropertyDescriptor": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 151],
|
|
38
|
+
"Reflect.getPrototypeOf": [0, 11, 21, 23, 24, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 83, 86, 88, 92, 94, 101, 102, 103, 104, 114, 152],
|
|
39
|
+
"Reflect.has": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 154],
|
|
40
|
+
"Reflect.isExtensible": [0, 7, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 84, 86, 88, 92, 94, 101, 102, 103, 104, 114, 155],
|
|
41
|
+
"Reflect.ownKeys": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 156],
|
|
42
|
+
"Reflect.preventExtensions": [0, 11, 21, 23, 25, 26, 29, 36, 37, 39, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 157],
|
|
43
|
+
"Reflect.setPrototypeOf": [0, 4, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 89, 92, 94, 101, 102, 103, 104, 114, 158],
|
|
44
|
+
"String.prototype.codePointAt": [0, 11, 21, 22, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 97, 101, 102, 103, 104, 108, 109, 114, 159],
|
|
45
|
+
"String.fromCodePoint": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 160],
|
|
46
|
+
"String.raw": [0, 11, 21, 22, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 108, 109, 114, 161],
|
|
47
|
+
"String.prototype.repeat": [0, 11, 21, 22, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 99, 101, 102, 103, 104, 108, 109, 114, 162],
|
|
48
|
+
"Object.entries": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 87, 88, 90, 92, 94, 101, 102, 103, 104, 114, 135],
|
|
49
|
+
"Object.getOwnPropertyDescriptors": [0, 11, 21, 23, 25, 26, 27, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 88, 92, 94, 101, 102, 103, 104, 114, 137],
|
|
50
|
+
"Object.values": [0, 11, 21, 23, 25, 26, 29, 36, 37, 54, 57, 58, 60, 66, 73, 74, 75, 79, 81, 82, 86, 87, 88, 90, 92, 94, 101, 102, 103, 104, 114, 146],
|
|
51
|
+
"focus-visible": [163]
|
|
51
52
|
},
|
|
52
|
-
"maxSize":
|
|
53
|
-
"baseSize": 11897
|
|
53
|
+
"maxSize": 87683
|
|
54
54
|
}
|
|
@@ -506,14 +506,22 @@ class TraceProcessor {
|
|
|
506
506
|
const pidToTid = new Map();
|
|
507
507
|
|
|
508
508
|
for (const pid of new Set(mainFramePids)) {
|
|
509
|
-
|
|
510
|
-
const threadNameEvt = keyEvents.find(e =>
|
|
509
|
+
const threadEvents = keyEvents.filter(e =>
|
|
511
510
|
e.cat === '__metadata' &&
|
|
512
511
|
e.pid === pid &&
|
|
513
512
|
e.ph === 'M' &&
|
|
514
|
-
e.name === 'thread_name'
|
|
515
|
-
e.args.name === 'CrRendererMain'
|
|
513
|
+
e.name === 'thread_name'
|
|
516
514
|
);
|
|
515
|
+
|
|
516
|
+
// While renderer tids are generally predictable, we'll doublecheck it
|
|
517
|
+
let threadNameEvt = threadEvents.find(e => e.args.name === 'CrRendererMain');
|
|
518
|
+
|
|
519
|
+
// `CrRendererMain` can be missing if chrome is launched with the `--single-process` flag.
|
|
520
|
+
// In this case, page tasks will be run in the browser thread.
|
|
521
|
+
if (!threadNameEvt) {
|
|
522
|
+
threadNameEvt = threadEvents.find(e => e.args.name === 'CrBrowserMain');
|
|
523
|
+
}
|
|
524
|
+
|
|
517
525
|
const tid = threadNameEvt?.tid;
|
|
518
526
|
|
|
519
527
|
if (!tid) {
|
package/package.json
CHANGED