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

feat: add the ability to launch a browser with an http string #122

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lucafabbian
Copy link

Now you can use "launch" to connect to an existing browser by passing either an http:// or a ws:// string
I've also implemented the old way of doing that as a legacy option - old code will be recognised as wrong by typescript, but it will not break, with a negligible impact on the codebase and on performance

@chaosharmonic
Copy link
Contributor

chaosharmonic commented Jan 8, 2025

This is for #30, right?

@@ -136,6 +136,8 @@ const browser = await launch();

// Connect to first browser instead
const anotherBrowser = await launch({ wsEndpoint: browser.wsEndpoint() });
// or simply...
const anotherBrowser2 = await launch(browser.wsEndpoint());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this API change. Could we add a endpoint option (with wsEndpoint printing a "this is deprecated use endpoint instead") which supports both http and ws endpoints?

@lino-levan lino-levan changed the title Refactor launch feat: add the ability to launch a browser with an http string Jan 8, 2025
@chaosharmonic
Copy link
Contributor

It's also worth noting that connect is separate from launch on both Puppeteer and Playwright, which is part of the design consideration that went into separating them

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

Successfully merging this pull request may close these issues.

3 participants