lighthouse-core/gather/gather-runner.js
/**
   * Populates the important base artifacts from a fully loaded test page.
   * Currently must be run before `start-url` gatherer so that `WebAppManifest`
   * will be available to it.
   * @param {LH.Gatherer.PassContext} passContext
   */
Populates the important base artifacts from a fully loaded test page.
Currently must be run before `start-url` gatherer so that `WebAppManifest`
will be available to it.
Populates the important base artifacts from a fully loaded test page . Currently must be run before ` start - url ` gatherer so that ` WebAppManifest ` will be available to it .
static async populateBaseArtifacts(passContext) {
    const baseArtifacts = passContext.baseArtifacts;
    baseArtifacts.URL.finalUrl = passContext.url;
    baseArtifacts.WebAppManifest = await GatherRunner.getWebAppManifest(passContext);
    baseArtifacts.Stacks = await stacksGatherer(passContext);
    const devtoolsLog = baseArtifacts.devtoolsLogs[passContext.passConfig.passName];
    const userAgentEntry = devtoolsLog.find(entry =>
      entry.method === 'Network.requestWillBeSent' &&
      !!entry.params.request.headers['User-Agent']
    );
    if (userAgentEntry) {
      baseArtifacts.NetworkUserAgent = userAgentEntry.params.request.headers['User-Agent'];
    }
  }
static async populateBaseArtifacts ( passContext ) { const baseArtifacts = passContext . baseArtifacts ; baseArtifacts . URL . finalUrl = passContext . url ; baseArtifacts . WebAppManifest = await GatherRunner . getWebAppManifest ( passContext ) ; baseArtifacts . Stacks = await stacksGatherer ( passContext ) ; const devtoolsLog = baseArtifacts . devtoolsLogs [ passContext . passConfig . passName ] ; const userAgentEntry = devtoolsLog . find ( entry => entry . method === 'Network.requestWillBeSent' && ! ! entry . params . request . headers [ 'User-Agent' ] ) ; if ( userAgentEntry ) { baseArtifacts . NetworkUserAgent = userAgentEntry . params . request . headers [ 'User-Agent' ] ; } }
Populates the important base artifacts from a fully loaded test page.
Populates the important base artifacts from a fully loaded test page .
// Copy redirected URL to artifact. // Fetch the manifest, if it exists. // Find the NetworkUserAgent actually used in the devtoolsLogs. // @ts-ignore - guaranteed to exist by the find above