diff --git a/lighthouse-core/fraggle-rock/gather/runner-helpers.js b/lighthouse-core/fraggle-rock/gather/runner-helpers.js index 903d4dda6de8..ee8ac4fa5bb7 100644 --- a/lighthouse-core/fraggle-rock/gather/runner-helpers.js +++ b/lighthouse-core/fraggle-rock/gather/runner-helpers.js @@ -15,7 +15,6 @@ * @property {LH.Gatherer.GatherMode} gatherMode * @property {Map} computedCache * @property {LH.Config.Settings} settings - * @property {string} url */ /** @typedef {Record>} IntermediateArtifacts */ @@ -75,7 +74,6 @@ async function collectPhaseArtifacts(options) { gatherMode, computedCache, settings, - url, } = options; const priorPhase = phaseToPriorPhase[phase]; const priorPhaseArtifacts = (priorPhase && artifactState[priorPhase]) || {}; @@ -92,7 +90,6 @@ async function collectPhaseArtifacts(options) { : /** @type {Dependencies} */ ({}); return gatherer[phase]({ - url, gatherMode, driver, baseArtifacts, diff --git a/lighthouse-core/fraggle-rock/gather/snapshot-runner.js b/lighthouse-core/fraggle-rock/gather/snapshot-runner.js index 578e90a71a30..a51d3ac9b13e 100644 --- a/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +++ b/lighthouse-core/fraggle-rock/gather/snapshot-runner.js @@ -46,7 +46,6 @@ async function snapshotGather(options) { const artifactDefinitions = config.artifacts || []; const artifactState = getEmptyArtifactState(); await collectPhaseArtifacts({ - url, phase: 'getArtifact', gatherMode: 'snapshot', driver, diff --git a/lighthouse-core/fraggle-rock/gather/timespan-runner.js b/lighthouse-core/fraggle-rock/gather/timespan-runner.js index f9be1e664ea6..870b04e2f37f 100644 --- a/lighthouse-core/fraggle-rock/gather/timespan-runner.js +++ b/lighthouse-core/fraggle-rock/gather/timespan-runner.js @@ -37,7 +37,6 @@ async function startTimespanGather(options) { const artifactState = getEmptyArtifactState(); /** @type {Omit} */ const phaseOptions = { - url: initialUrl, driver, artifactDefinitions, artifactState, @@ -54,7 +53,6 @@ async function startTimespanGather(options) { return { async endTimespanGather() { const finalUrl = await driver.url(); - phaseOptions.url = finalUrl; const runnerOptions = {config, computedCache}; const artifacts = await Runner.gather( diff --git a/lighthouse-core/gather/gatherers/seo/robots-txt.js b/lighthouse-core/gather/gatherers/seo/robots-txt.js index 03db48c92920..220d654e2ca2 100644 --- a/lighthouse-core/gather/gatherers/seo/robots-txt.js +++ b/lighthouse-core/gather/gatherers/seo/robots-txt.js @@ -46,7 +46,8 @@ class RobotsTxt extends FRGatherer { }); } - const robotsUrl = new URL('/robots.txt', passContext.url).href; + const {finalUrl} = passContext.baseArtifacts.URL; + const robotsUrl = new URL('/robots.txt', finalUrl).href; await passContext.driver.fetcher.enable(); return passContext.driver.fetcher.fetchResource(robotsUrl) .catch(err => ({status: null, content: null, errorMessage: err.message})); diff --git a/lighthouse-core/gather/gatherers/web-app-manifest.js b/lighthouse-core/gather/gatherers/web-app-manifest.js index cadbd9111fb5..6736755d4653 100644 --- a/lighthouse-core/gather/gatherers/web-app-manifest.js +++ b/lighthouse-core/gather/gatherers/web-app-manifest.js @@ -94,8 +94,8 @@ class WebAppManifest extends FRGatherer { */ getArtifact(context) { const driver = context.driver; - - return WebAppManifest.getWebAppManifest(driver.defaultSession, context.url); + const {finalUrl} = context.baseArtifacts.URL; + return WebAppManifest.getWebAppManifest(driver.defaultSession, finalUrl); } } diff --git a/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js b/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js index 4376dda1dc35..cd17908c3d2e 100644 --- a/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/runner-helpers-test.js @@ -132,7 +132,6 @@ describe('collectPhaseArtifacts', () => { it(`should run the ${phase} phase of gatherers in ${gatherMode} mode`, async () => { const {artifactDefinitions, gatherers} = createGathererSet(); await helpers.collectPhaseArtifacts({ - url: 'https://example.com', driver, artifactDefinitions, artifactState, @@ -157,7 +156,6 @@ describe('collectPhaseArtifacts', () => { it('should gather the artifacts', async () => { const {artifactDefinitions} = createGathererSet(); await helpers.collectPhaseArtifacts({ - url: 'https://example.com', driver, artifactDefinitions, artifactState, @@ -190,7 +188,6 @@ describe('collectPhaseArtifacts', () => { ]; await helpers.collectPhaseArtifacts({ - url: 'https://example.com', driver, artifactDefinitions, artifactState, @@ -224,7 +221,6 @@ describe('collectPhaseArtifacts', () => { const {artifactDefinitions, gatherers} = createGathererSet(); await helpers.collectPhaseArtifacts({ - url: 'https://example.com', driver, artifactDefinitions, artifactState, diff --git a/lighthouse-core/test/gather/gatherers/css-usage-test.js b/lighthouse-core/test/gather/gatherers/css-usage-test.js index eda00c61215f..a9868ea289e9 100644 --- a/lighthouse-core/test/gather/gatherers/css-usage-test.js +++ b/lighthouse-core/test/gather/gatherers/css-usage-test.js @@ -42,7 +42,6 @@ describe('.getArtifact', () => { /** @type {LH.Gatherer.FRTransitionalContext} */ const context = { driver: driver.asDriver(), - url: 'https://example.com', gatherMode: 'snapshot', computedCache: new Map(), baseArtifacts: createMockBaseArtifacts(), @@ -98,7 +97,6 @@ describe('.getArtifact', () => { /** @type {LH.Gatherer.FRTransitionalContext} */ const context = { driver: driver.asDriver(), - url: 'https://example.com', gatherMode: 'timespan', computedCache: new Map(), baseArtifacts: createMockBaseArtifacts(), @@ -154,7 +152,6 @@ describe('.getArtifact', () => { /** @type {LH.Gatherer.FRTransitionalContext} */ const context = { driver: driver.asDriver(), - url: 'https://example.com', gatherMode: 'snapshot', computedCache: new Map(), baseArtifacts: createMockBaseArtifacts(), diff --git a/types/gatherer.d.ts b/types/gatherer.d.ts index d57223d741c1..c25026aace2b 100644 --- a/types/gatherer.d.ts +++ b/types/gatherer.d.ts @@ -47,8 +47,6 @@ declare module Gatherer { /** The limited context interface shared between pre and post Fraggle Rock Lighthouse. */ interface FRTransitionalContext { - /** The URL of the page that is currently active. Might be `about:blank` in the before phases */ - url: string; /** The gather mode Lighthouse is currently in. */ gatherMode: GatherMode; /** The connection to the page being analyzed. */