Skip to content
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

Open
Shivam93937 opened this issue Nov 25, 2024 · 1 comment
Open

CLI flag to choose whether to open a new lighthouse page or not #16259

Shivam93937 opened this issue Nov 25, 2024 · 1 comment

Comments

@Shivam93937
Copy link

Shivam93937 commented Nov 25, 2024

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:
lh module changes

@adamraine
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants