Skip to content

Allow setup scripts per URL #9

@pbowyer

Description

@pbowyer

It would be very useful to be able to run a setup script for each URL in Chrome before lighthouse runs.

For example:

  • To log into a secured area
  • To set cookies
  • Even (and I don't know if this is possible - I've been spoiled by WPT) to change where a domain resolves

How?

I don't know. This issue is really a discussion starter to see if it's something you are interested in adding, and to think about how/if it's feasible.

Using Puppeteer to script interactions seems sensible. I've done some Googling for ideas.

I've seen this project uses chrome-launcher to set up Chrome rather than Puppeteer directly so that could be a complication.

Resources

Running Lighthouse on Authenticated Pages with Puppeteer
[2 ways to] Using Puppeteer with Lighthouse
chrome-launcher README
Connecting Puppeteer to a Chrome-Launcher instance.
chromelauncher_puppeteer.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions