lighthouse 11.3.0-dev.20231204 → 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.
@@ -42,7 +42,7 @@ declare class UsesHTTP2Audit extends Audit {
42
42
  * @param {LH.Artifacts.EntityClassification} classifiedEntities
43
43
  * @return {boolean}
44
44
  */
45
- static isStaticAsset(networkRequest: LH.Artifacts.NetworkRequest, classifiedEntities: LH.Artifacts.EntityClassification): boolean;
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 isStaticAsset(networkRequest, classifiedEntities) {
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 && !entity.isUnrecognized) return false;
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.isStaticAsset(record, classifiedEntities)) continue;
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/109.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/109.0.0.0 Safari/537.36";
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
@@ -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/109.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/109.0.0.0 Safari/537.36'; // eslint-disable-line max-len
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,
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import {getDomain} from 'tldts';
7
+ import {getDomain} from 'tldts-icann';
8
8
 
9
9
  import {Util} from '../../shared/util.js';
10
10
  import {LighthouseError} from './lh-error.js';
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. Difference found at: ${k}`);
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.20231204",
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.22",
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"