-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Feature proposal: Ability to pass browserUrl to puppeteer.connect #3537
Comments
@lukaszfiszer fair. I'd be happy to review a PR. |
any update on this issue? |
@andrejska my PR #3558 is ready and awaiting review |
aslushnikov
pushed a commit
that referenced
this issue
Jan 14, 2019
The `browserURL` option allows to connect to a browser that exposed it's remote debugging protocol on a known port. Fixes #3537
aslushnikov
added a commit
to aslushnikov/puppeteer
that referenced
this issue
Jan 14, 2019
This patch: - renames `browserUrl` into `browserURL` - cleans up some code - adds tests for error handling References puppeteer#3537
aslushnikov
added a commit
that referenced
this issue
Jan 14, 2019
This patch: - renames `browserUrl` into `browserURL` - cleans up some code - adds tests for error handling References #3537
Thanks for adding this feature, it is a game changer. |
How does one do this for Firefox? (After say using web-ext run to launch Firefox with an extension) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Add support for new
browserUrl
property inoptions
object passed topuppeteer.connect(options)
. It would accept url in form ofhttp://{host}:{port}
which should point to the existing Chromium instance. For example:If this option is passed to
puppeteer.connect
, thenbrowserWSEndpoint
is retrieved fromhttp://{host}:{port}/json/version
and passednew Connection()
. The rest of the flow remains unchanged.If you're OK with the proposal I could write up the code and the tests
Background
Currently to attach Puppeteer to an existing Chrome instance, one must provide url of browser websocket endpoint. For example:
However, as many issues raised here show (#2790, #1645, #940)
browserWSEndpoint
is often not known to the code callingpuppeteer.connect
, for example because Chrome was lunched in a docker container.In such a case, a common and repeating scenario is to:
http://{host}:{port}/json/version
browserWSEndpoint
from and use it inpuppeteer.connect
The steps above could be done by puppeteer resulting in less code in the user-land.
The text was updated successfully, but these errors were encountered: