-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI flag to choose whether to open a new lighthouse page or not #16259
Comments
This should be possible already with the Node API: https://github.com/GoogleChrome/lighthouse/blob/main/docs/puppeteer.md#option-1-launch-chrome-with-puppeteer-and-handoff-to-lighthouse Is there a use case where you need to use the CLI and can't use the Node API? |
@adamraine I need to use the functionalities provided by lighthouse CI, (is-median runs, multiple runs, etc.) I cannot use node API if I want to use LIghthouse CI. |
Gotcha. I think a solution in Lighthouse CLI could be tricky because the CLI can still connect to an existing browser instance with multiple tabs open. Maybe a quick solution would be to re-use a page if it's the only page open. |
Yes agreed, this is the solution i proposed and I need a CLI flag for this, or I will have to fork and maintain the mono repo lhci and lighthouse too. |
@adamraine |
@brendankenny Any opinions from your side? |
We are going to accept this proposal, add a Ideally, we could modify lighthouse CI to allow testing via the Node API so that a specific puppeteer page can be used, but that will be a much larger change than what is proposed here. |
Also, do we have a timeline for this feature? |
Feature request summary
A CLI flag (something like
--reuse-page
) to re-use the existing page that was running on the browser that puppeteer connects to.The page can be selected from
await lhBrowser.pages()
.Are you willing to work on this yourself?
Yes
What is the motivation or use case for changing this?
It will help run lighthouse programmatically inside applications like CEF and Electron where opening a new page (by default) causes a failure when connecting to it through remote debugging port.
How is this beneficial to Lighthouse?
It will widen the audience to which lighthouse can be used and increase the tool's users.
Mentioned the changes in the screenshot:
The text was updated successfully, but these errors were encountered: