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
Added info on how to find the browserWSEndpoint #780
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
docs/api.md
Outdated
@@ -226,7 +226,9 @@ Closes browser with all the pages (if any were opened). The browser object itsel | |||
- returns: <[string]> Browser websocket url. | |||
|
|||
Browser websocket endpoint which could be used as an argument to | |||
[puppeteer.connect](#puppeteerconnectoptions). | |||
[puppeteer.connect](#puppeteerconnectoptions). The format is `ws://${host}:${port}/page/<id>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ironically, this is page's debugging URL, not browser's. It might work for now, but might not eventually.
The Browser WS is dumped by the browser in its stderr. Note: this only happens if the browser is launched with a remote-debugging-port
flag.
Check out how we extract browser web socket from stderr in the Launcher.js
Hey @JakeGinnivan, thank you for the PR! Could you please share your user scenario - why would you need a way to get the browser endpoint manually? |
Yeah sure. We are doing visual regression testing and have mac, windows and linux machines. To remove differences like font rendering etc we are just using the docker container I figured it was the page debugging endpoint but couldn't figure out how to resolve the browsers endpoint. |
@JakeGinnivan do you want to update this PR with a relevant information to ease the life of future generations? Feel free to close it if you don't. |
btw see "How do I access the browser target?" on ChromeDevTools/devtools-protocol#55 .. i'll be moving that into the real site soon... so that is probably a better place to document the browserWs endpoint details than here. (So i'd recommend nuking L231 and instead linking up that doc) |
Will get this updated today, appreciate the info! |
@paulirish I have done both for the moment. The redundant info can be removed later if need be but having it directly in this doc I think will be handy for people. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the url is /json and not /json/version to get the debugger url
@pierre-moire /json lists page endpoints, the browser endpoint is only available at /json/version. |
docs/api.md
Outdated
[puppeteer.connect](#puppeteerconnectoptions). | ||
[puppeteer.connect](#puppeteerconnectoptions). The format is `ws://${host}:${port}/browser/<id>` | ||
|
||
You can find the `webSocketDebuggerUrl` from `http://${host}:${port}/json/version`. More about the chrome devtools protocol is available at [https://chromedevtools.github.io/devtools-protocol](https://chromedevtools.github.io/devtools-protocol), the FAQ is currently available at [devtools-protocol/#55 (FAQ)](https://github.com/ChromeDevTools/devtools-protocol/issues/55) and will be added to the site soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just update this to point to https://chromedevtools.github.io/devtools-protocol/#faq
(it will deploy soon if it hasn't already)
@paulirish updated. The FAQ header is missing an anchor so I anchored directly to the interesting header |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Hi guys, a newbie here :–) Seems like going to {
"Browser": "Chrome/61.0.3163.100",
"Protocol-Version": "1.2",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
"V8-Version": "6.1.534.41",
"WebKit-Version": "537.36 (@57c9d07b416b5a2ea23d28247300e4af36329bdc)"
} Launching Chrome on macOS with Ultimately I'm trying to set up Chrome as a docker microservice and talk to it using puppeteer from a Node.js microservice. All works when the browser is in the same container and I launch it with |
It took me a while to figure this out, thought it may help others.