lighthouse 9.4.0-dev.20220224 → 9.4.0-dev.20220225

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.
@@ -53,6 +53,7 @@ import redirectsHistoryPushState from './test-definitions/redirects-history-push
53
53
  import redirectsMultipleServer from './test-definitions/redirects-multiple-server.js';
54
54
  import redirectsSingleClient from './test-definitions/redirects-single-client.js';
55
55
  import redirectsSingleServer from './test-definitions/redirects-single-server.js';
56
+ import redirectsSelf from './test-definitions/redirects-self.js';
56
57
  import screenshot from './test-definitions/screenshot.js';
57
58
  import seoFailing from './test-definitions/seo-failing.js';
58
59
  import seoPassing from './test-definitions/seo-passing.js';
@@ -111,6 +112,7 @@ const smokeTests = [
111
112
  redirectsMultipleServer,
112
113
  redirectsSingleClient,
113
114
  redirectsSingleServer,
115
+ redirectsSelf,
114
116
  screenshot,
115
117
  seoFailing,
116
118
  seoPassing,
@@ -210,6 +210,7 @@ async function _computeNavigationResult(
210
210
  async function _navigation(navigationContext) {
211
211
  const artifactState = getEmptyArtifactState();
212
212
  const phaseState = {
213
+ url: await navigationContext.driver.url(),
213
214
  gatherMode: /** @type {const} */ ('navigation'),
214
215
  driver: navigationContext.driver,
215
216
  computedCache: navigationContext.computedCache,
@@ -223,6 +224,7 @@ async function _navigation(navigationContext) {
223
224
  await collectPhaseArtifacts({phase: 'startInstrumentation', ...phaseState});
224
225
  await collectPhaseArtifacts({phase: 'startSensitiveInstrumentation', ...phaseState});
225
226
  const navigateResult = await _navigate(navigationContext);
227
+ phaseState.url = navigateResult.finalUrl;
226
228
  await collectPhaseArtifacts({phase: 'stopSensitiveInstrumentation', ...phaseState});
227
229
  await collectPhaseArtifacts({phase: 'stopInstrumentation', ...phaseState});
228
230
  await _cleanupNavigation(navigationContext);
@@ -15,6 +15,7 @@
15
15
  * @property {LH.Gatherer.GatherMode} gatherMode
16
16
  * @property {Map<string, LH.ArbitraryEqualityMap>} computedCache
17
17
  * @property {LH.Config.Settings} settings
18
+ * @property {string} url
18
19
  */
19
20
 
20
21
  /** @typedef {Record<string, Promise<any>>} IntermediateArtifacts */
@@ -74,6 +75,7 @@ async function collectPhaseArtifacts(options) {
74
75
  gatherMode,
75
76
  computedCache,
76
77
  settings,
78
+ url,
77
79
  } = options;
78
80
  const priorPhase = phaseToPriorPhase[phase];
79
81
  const priorPhaseArtifacts = (priorPhase && artifactState[priorPhase]) || {};
@@ -90,7 +92,7 @@ async function collectPhaseArtifacts(options) {
90
92
  : /** @type {Dependencies} */ ({});
91
93
 
92
94
  return gatherer[phase]({
93
- url: await driver.url(),
95
+ url,
94
96
  gatherMode,
95
97
  driver,
96
98
  baseArtifacts,
@@ -27,7 +27,7 @@ async function snapshot(options) {
27
27
 
28
28
  /** @type {Map<string, LH.ArbitraryEqualityMap>} */
29
29
  const computedCache = new Map();
30
- const url = await options.page.url();
30
+ const url = await driver.url();
31
31
 
32
32
  const runnerOptions = {config, computedCache};
33
33
  const artifacts = await Runner.gather(
@@ -39,6 +39,7 @@ async function snapshot(options) {
39
39
  const artifactDefinitions = config.artifacts || [];
40
40
  const artifactState = getEmptyArtifactState();
41
41
  await collectPhaseArtifacts({
42
+ url,
42
43
  phase: 'getArtifact',
43
44
  gatherMode: 'snapshot',
44
45
  driver,
@@ -32,11 +32,12 @@ async function startTimespan(options) {
32
32
  /** @type {Map<string, LH.ArbitraryEqualityMap>} */
33
33
  const computedCache = new Map();
34
34
  const artifactDefinitions = config.artifacts || [];
35
- const requestedUrl = await options.page.url();
35
+ const requestedUrl = await driver.url();
36
36
  const baseArtifacts = await getBaseArtifacts(config, driver, {gatherMode: 'timespan'});
37
37
  const artifactState = getEmptyArtifactState();
38
38
  /** @type {Omit<import('./runner-helpers.js').CollectPhaseArtifactOptions, 'phase'>} */
39
39
  const phaseOptions = {
40
+ url: requestedUrl,
40
41
  driver,
41
42
  artifactDefinitions,
42
43
  artifactState,
@@ -52,7 +53,9 @@ async function startTimespan(options) {
52
53
 
53
54
  return {
54
55
  async endTimespan() {
55
- const finalUrl = await options.page.url();
56
+ const finalUrl = await driver.url();
57
+ phaseOptions.url = finalUrl;
58
+
56
59
  const runnerOptions = {config, computedCache};
57
60
  const artifacts = await Runner.gather(
58
61
  async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse",
3
- "version": "9.4.0-dev.20220224",
3
+ "version": "9.4.0-dev.20220225",
4
4
  "description": "Automated auditing, performance metrics, and best practices for the web.",
5
5
  "main": "./lighthouse-core/index.js",
6
6
  "bin": {