lighthouse 12.6.1-dev.20250602 → 12.6.1-dev.20250603

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.
@@ -291,7 +291,7 @@ class RenderBlockingResources extends Audit {
291
291
  const headings = [
292
292
  {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
293
293
  {key: 'totalBytes', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize)},
294
- {key: 'wastedMs', valueType: 'timespanMs', label: str_(i18n.UIStrings.columnWastedMs)},
294
+ {key: 'wastedMs', valueType: 'timespanMs', label: str_(i18n.UIStrings.columnDuration)},
295
295
  ];
296
296
 
297
297
  const details = Audit.makeOpportunityDetails(headings, results,
@@ -41,7 +41,7 @@ class RenderBlockingInsight extends Audit {
41
41
  const headings = [
42
42
  {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
43
43
  {key: 'totalBytes', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize)},
44
- {key: 'wastedMs', valueType: 'timespanMs', label: str_(i18n.UIStrings.columnWastedMs)},
44
+ {key: 'wastedMs', valueType: 'timespanMs', label: str_(i18n.UIStrings.columnDuration)},
45
45
  ];
46
46
  /** @type {LH.Audit.Details.Table['items']} */
47
47
  const items = insight.renderBlockingRequests.map(request => ({
@@ -21,6 +21,7 @@ import {TotalBlockingTime} from './total-blocking-time.js';
21
21
  import {makeComputedArtifact} from '../computed-artifact.js';
22
22
  import {TimeToFirstByte} from './time-to-first-byte.js';
23
23
  import {LCPBreakdown} from './lcp-breakdown.js';
24
+ import {isUnderTest} from '../../lib/lh-env.js';
24
25
 
25
26
  class TimingSummary {
26
27
  /**
@@ -46,7 +47,9 @@ class TimingSummary {
46
47
  */
47
48
  const requestOrUndefined = (Artifact, artifact) => {
48
49
  return Artifact.request(artifact, context).catch(err => {
49
- log.error('lh:computed:TimingSummary', err);
50
+ if (isUnderTest) {
51
+ log.error('lh:computed:TimingSummary', err);
52
+ }
50
53
  return undefined;
51
54
  });
52
55
  };
@@ -58,11 +58,13 @@ export class ExecutionContext {
58
58
  */
59
59
  _evaluateInContext(expression: string, contextId: number | undefined, timeout: number): Promise<any>;
60
60
  /**
61
- * Note: Prefer `evaluate` instead.
62
61
  * Evaluate an expression in the context of the current page. If useIsolation is true, the expression
63
62
  * will be evaluated in a content script that has access to the page's DOM but whose JavaScript state
64
63
  * is completely separate.
65
64
  * Returns a promise that resolves on the expression's value.
65
+ *
66
+ * @deprecated Use `evaluate` instead! It has a better API, and unlike `evaluateAsync` doesn't sometimes
67
+ * execute invalid code.
66
68
  * @param {string} expression
67
69
  * @param {{useIsolation?: boolean}=} options
68
70
  * @return {Promise<*>}
@@ -151,11 +151,13 @@ class ExecutionContext {
151
151
  }
152
152
 
153
153
  /**
154
- * Note: Prefer `evaluate` instead.
155
154
  * Evaluate an expression in the context of the current page. If useIsolation is true, the expression
156
155
  * will be evaluated in a content script that has access to the page's DOM but whose JavaScript state
157
156
  * is completely separate.
158
157
  * Returns a promise that resolves on the expression's value.
158
+ *
159
+ * @deprecated Use `evaluate` instead! It has a better API, and unlike `evaluateAsync` doesn't sometimes
160
+ * execute invalid code.
159
161
  * @param {string} expression
160
162
  * @param {{useIsolation?: boolean}=} options
161
163
  * @return {Promise<*>}
@@ -30,7 +30,10 @@ class CSSUsage extends BaseGatherer {
30
30
 
31
31
  // Force style to recompute.
32
32
  // Doesn't appear to be necessary in newer versions of Chrome.
33
- await executionContext.evaluateAsync('getComputedStyle(document.body)');
33
+ /* global window, document */
34
+ await executionContext.evaluate(() => window.getComputedStyle(document.body), {
35
+ args: [],
36
+ });
34
37
 
35
38
  const {ruleUsage} = await session.sendCommand('CSS.stopRuleUsageTracking');
36
39
  await session.sendCommand('CSS.disable');
@@ -74,7 +74,10 @@ class Stylesheets extends BaseGatherer {
74
74
 
75
75
  // Force style to recompute.
76
76
  // Doesn't appear to be necessary in newer versions of Chrome.
77
- await executionContext.evaluateAsync('getComputedStyle(document.body)');
77
+ /* global window, document */
78
+ await executionContext.evaluate(() => window.getComputedStyle(document.body), {
79
+ args: [],
80
+ });
78
81
 
79
82
  session.off('CSS.styleSheetAdded', this._onStylesheetAdded);
80
83
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "12.6.1-dev.20250602",
4
+ "version": "12.6.1-dev.20250603",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {