lighthouse 11.3.0-dev.20231203 → 11.3.0-dev.20231205
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/dobetterweb/uses-http2.d.ts +1 -1
- package/core/audits/dobetterweb/uses-http2.js +8 -5
- package/core/config/constants.d.ts +2 -2
- package/core/config/constants.js +2 -2
- package/core/lib/url-utils.js +1 -1
- package/core/runner.js +5 -1
- package/core/scripts/download-chrome.sh +1 -1
- package/package.json +2 -2
|
@@ -42,7 +42,7 @@ declare class UsesHTTP2Audit extends Audit {
|
|
|
42
42
|
* @param {LH.Artifacts.EntityClassification} classifiedEntities
|
|
43
43
|
* @return {boolean}
|
|
44
44
|
*/
|
|
45
|
-
static
|
|
45
|
+
static isMultiplexableStaticAsset(networkRequest: LH.Artifacts.NetworkRequest, classifiedEntities: LH.Artifacts.EntityClassification): boolean;
|
|
46
46
|
/**
|
|
47
47
|
* Determine the set of resources that aren't HTTP/2 but should be.
|
|
48
48
|
* We're a little conservative about what we surface for a few reasons:
|
|
@@ -152,16 +152,19 @@ class UsesHTTP2Audit extends Audit {
|
|
|
152
152
|
* @param {LH.Artifacts.EntityClassification} classifiedEntities
|
|
153
153
|
* @return {boolean}
|
|
154
154
|
*/
|
|
155
|
-
static
|
|
155
|
+
static isMultiplexableStaticAsset(networkRequest, classifiedEntities) {
|
|
156
156
|
if (!STATIC_RESOURCE_TYPES.has(networkRequest.resourceType)) return false;
|
|
157
157
|
|
|
158
158
|
// Resources from third-parties that are less than 100 bytes are usually tracking pixels, not actual resources.
|
|
159
159
|
// They can masquerade as static types though (gifs, documents, etc)
|
|
160
160
|
if (networkRequest.resourceSize < 100) {
|
|
161
|
-
// This logic needs to be revisited.
|
|
162
|
-
// See https://github.com/GoogleChrome/lighthouse/issues/14661
|
|
163
161
|
const entity = classifiedEntities.entityByUrl.get(networkRequest.url);
|
|
164
|
-
if (entity
|
|
162
|
+
if (entity) {
|
|
163
|
+
// Third-party assets are multiplexable in their first-party context.
|
|
164
|
+
if (classifiedEntities.firstParty?.name === entity.name) return true;
|
|
165
|
+
// Skip recognizable third-parties' requests.
|
|
166
|
+
if (!entity.isUnrecognized) return false;
|
|
167
|
+
}
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
return true;
|
|
@@ -199,7 +202,7 @@ class UsesHTTP2Audit extends Audit {
|
|
|
199
202
|
/** @type {Map<string, Array<LH.Artifacts.NetworkRequest>>} */
|
|
200
203
|
const groupedByOrigin = new Map();
|
|
201
204
|
for (const record of networkRecords) {
|
|
202
|
-
if (!UsesHTTP2Audit.
|
|
205
|
+
if (!UsesHTTP2Audit.isMultiplexableStaticAsset(record, classifiedEntities)) continue;
|
|
203
206
|
if (UrlUtils.isLikeLocalhost(record.parsedURL.host)) continue;
|
|
204
207
|
const existing = groupedByOrigin.get(record.parsedURL.securityOrigin) || [];
|
|
205
208
|
existing.push(record);
|
|
@@ -76,7 +76,7 @@ declare const MOTOGPOWER_EMULATION_METRICS: Required<LH.SharedFlagsSettings['scr
|
|
|
76
76
|
* @type {Required<LH.SharedFlagsSettings['screenEmulation']>}
|
|
77
77
|
*/
|
|
78
78
|
declare const DESKTOP_EMULATION_METRICS: Required<LH.SharedFlagsSettings['screenEmulation']>;
|
|
79
|
-
declare const MOTOG4_USERAGENT: "Mozilla/5.0 (Linux; Android 11; moto g power (2022)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
80
|
-
declare const DESKTOP_USERAGENT: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
79
|
+
declare const MOTOG4_USERAGENT: "Mozilla/5.0 (Linux; Android 11; moto g power (2022)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36";
|
|
80
|
+
declare const DESKTOP_USERAGENT: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36";
|
|
81
81
|
export {};
|
|
82
82
|
//# sourceMappingURL=constants.d.ts.map
|
package/core/config/constants.js
CHANGED
|
@@ -80,8 +80,8 @@ const screenEmulationMetrics = {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
const MOTOG4_USERAGENT = 'Mozilla/5.0 (Linux; Android 11; moto g power (2022)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
84
|
-
const DESKTOP_USERAGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
83
|
+
const MOTOG4_USERAGENT = 'Mozilla/5.0 (Linux; Android 11; moto g power (2022)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36'; // eslint-disable-line max-len
|
|
84
|
+
const DESKTOP_USERAGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'; // eslint-disable-line max-len
|
|
85
85
|
|
|
86
86
|
const userAgents = {
|
|
87
87
|
mobile: MOTOG4_USERAGENT,
|
package/core/lib/url-utils.js
CHANGED
package/core/runner.js
CHANGED
|
@@ -317,7 +317,11 @@ class Runner {
|
|
|
317
317
|
for (const k of keys) {
|
|
318
318
|
if (!isDeepEqual(normalizedGatherSettings[k], normalizedAuditSettings[k])) {
|
|
319
319
|
throw new Error(
|
|
320
|
-
`Cannot change settings between gathering and auditing
|
|
320
|
+
`Cannot change settings between gathering and auditing…
|
|
321
|
+
Difference found at: \`${k}\`
|
|
322
|
+
${normalizedGatherSettings[k]}
|
|
323
|
+
vs
|
|
324
|
+
${normalizedAuditSettings[k]}`);
|
|
321
325
|
}
|
|
322
326
|
}
|
|
323
327
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "11.3.0-dev.
|
|
4
|
+
"version": "11.3.0-dev.20231205",
|
|
5
5
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
6
6
|
"main": "./core/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
"semver": "^5.3.0",
|
|
205
205
|
"speedline-core": "^1.4.3",
|
|
206
206
|
"third-party-web": "^0.24.0",
|
|
207
|
-
"tldts": "^6.0
|
|
207
|
+
"tldts-icann": "^6.1.0",
|
|
208
208
|
"ws": "^7.0.0",
|
|
209
209
|
"yargs": "^17.3.1",
|
|
210
210
|
"yargs-parser": "^21.0.0"
|