Skip to main content

Page Loaded Conditions

By default, Lighthouse uses heuristics to decide when to finish a performance test. Page loaded conditions allow you to add an additional custom criterion.

Here are some cases when this can be useful:

  • you have a dashboard that only starts rendering after a slow XHR request has finished
  • you have a chat widget that loads late and sometimes isn't included in the test result, leading to a spike in your performance score

Creating a page loaded condition

  1. Create a new page or edit an existing one
  2. Open the Advanced Settings
  3. Expand the Page Loaded Condition section

Finding the setting to configure when Lighthouse finishes the test

  1. Click New
  2. Enter a JavaScript condition that must be fulfilled before the test finishes

Setting up a JavaScript expression that needs to be fulfilled when the test finishes

  1. Click Create
  2. Save the page you edited

Disable default wait

By default Lighthouse and DebugBear wait for the network and CPU to become idle before finishing the test. In some cases this means the test will continue until it hits a timeout, for example if there's continuous CPU processing or many long-running network requests.

You can disable the default wait conditions and rely only on your own page loaded criteron.

Disable Lighthouse default wait