lighthouse-core/gather/gather-runner.js
/**
   * Loads options.url with specified options. If the main document URL
   * redirects, options.url will be updated accordingly. As such, options.url
   * will always represent the post-redirected URL. options.requestedUrl is the
   * pre-redirect starting URL. If the navigation errors with "expected" errors such as
   * NO_FCP, a `navigationError` is returned.
   * @param {Driver} driver
   * @param {LH.Gatherer.PassContext} passContext
   * @return {Promise<{navigationError?: LH.LighthouseError}>}
   */
Loads options.url with specified options. If the main document URL
redirects, options.url will be updated accordingly. As such, options.url
will always represent the post-redirected URL. options.requestedUrl is the
pre-redirect starting URL. If the navigation errors with "expected" errors such as
NO_FCP, a `navigationError` is returned.
Loads options . url with specified options . If the main document URL redirects options . url will be updated accordingly . As such options . url will always represent the post - redirected URL . options . requestedUrl is the pre - redirect starting URL . If the navigation errors with " expected " errors such as NO_FCP a ` navigationError ` is returned .
static async loadPage(driver, passContext) {
    const gatherers = passContext.passConfig.gatherers;
    const status = {
      msg: 'Loading page & waiting for onload',
      id: `lh:gather:loadPage-${passContext.passConfig.passName}`,
      args: [gatherers.map(g => g.instance.name).join(', ')],
    };
    log.time(status);
    try {
      const finalUrl = await driver.gotoURL(passContext.url, {
        waitForFCP: passContext.passConfig.recordTrace,
        waitForLoad: true,
        passContext,
      });
      passContext.url = finalUrl;
    } catch (err) {
      if (err.code === 'NO_FCP' || err.code === 'PAGE_HUNG') {
        return {navigationError: err};
      }
      throw err;
    } finally {
      log.timeEnd(status);
    }
    return {};
  }
static async loadPage ( driver , passContext ) { const gatherers = passContext . passConfig . gatherers ; const status = { msg : 'Loading page & waiting for onload' , id : ` ${ passContext . passConfig . passName } ` , args : [ gatherers . map ( g => g . instance . name ) . join ( ', ' ) ] , } ; log . time ( status ) ; try { const finalUrl = await driver . gotoURL ( passContext . url , { waitForFCP : passContext . passConfig . recordTrace , waitForLoad : true , passContext , } ) ; passContext . url = finalUrl ; } catch ( err ) { if ( err . code === 'NO_FCP' || err . code === 'PAGE_HUNG' ) { return { navigationError : err } ; } throw err ; } finally { log . timeEnd ( status ) ; } return { } ; }
Loads options.url with specified options.
Loads options . url with specified options .
// If it's one of our loading-based LHErrors, we'll treat it as a page load error.