http://localhost:9222/json/new returns "Could not create new page" when --headless is used
Reported by
cyrus....@gmail.com,
Feb 25 2017
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Steps to reproduce the problem: 1. google-chrome-unstable --remote-debugging-port=9222 --headless 2. curl http://localhost:9222/json/new What is the expected behavior? A new tab/target is created and returned via the HTTP endpoint. For example: { "description": "", "devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/754adcd6-73fe-453b-bca6-459b881d4599", "id": "754adcd6-73fe-453b-bca6-459b881d4599", "title": "", "type": "page", "url": "about:blank", "webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/754adcd6-73fe-453b-bca6-459b881d4599" } What went wrong? The new tab/target is not created; the HTTP endpoint replies with error code 500 and "Could not create new page". Did this work before? N/A Chrome version: 58.0.3018.3 Channel: stable OS Version: Debian GNU/Linux 8 Flash Version: n.a.
,
Feb 27 2017
,
Feb 27 2017
Able to reproduce the issue on Linux ubuntu 14.04 using chrome latest Canary-58.0.3024.0 as per the steps in comment#0. This in regression issue broken in beta-57.0.2987.54 & Working as expected in earlier builds of beta . Unable to provide bisect as we need to run step 1 through command prompt to proceed. Hence marking this issue as 'Untriaged'. Note: Issue specific to Linux OS. Thank you.
,
Feb 27 2017
,
Feb 27 2017
I don't think we support that http endpoint yet in headless mode. In the meantime, you could connect to the browser's DevTools target and use this command to open a page: https://chromedevtools.github.io/debugger-protocol-viewer/tot/Target/#method-createTarget
,
Feb 27 2017
Thanks for your reply. Yeah, I'm aware of that, but I was curious since /json/list works fine. Actually, it seems that there are problems with /json/close and /json/activate too, just noticed that... Can I assume that this issue will be closed once the HTTP endpoint will be fully supported in headless mode too?
,
Feb 27 2017
I'm somewhat wondering if it makes sense to support the http endpoint if the protocol already has equivalent functionality. Of course this is open for debate.
,
Feb 27 2017
You need to have at least one open target to open another and it's allowed to close all the targets; in this case it's impossible to open a new one without restarting Chrome.
,
Feb 28 2017
There's a special browser DevTools target (/devtools/browser) which will always be there even if no tabs are open.
,
Feb 28 2017
Oh cool, I didn't know about that... I noticed some weird behaviors though: - Target.getTargets never works via /devtools/browser (headless mode or not) [https://bugs.chromium.org/p/chromium/issues/detail?id=697048]; - Target.createTarget via /devtools/browser only works in headless mode. Now these are probably bugs/incomplete features but it would be nice IMO that /devtools/browser worked consistently regardless the headless mode.
,
Mar 4 2017
It's unclear, and a breaking change for production implementations based on headless, as to why the /json endpoint has suddenly stopped working (deprecated?) on headless. Back in June 2016, this issue (/json/new not working in headless) cropped up on the headless-dev group: https://groups.google.com/a/chromium.org/d/topic/headless-dev/I16EisDwza4/discussion In July 2016, new DevTools commands were added to support tab/context management on headless: https://groups.google.com/a/chromium.org/d/msg/headless-dev/I16EisDwza4/npjP4AN_CAAJ https://codereview.chromium.org/2119063002/ It was working fine, until recently, when the /json endpoint stopped working in headless, as reported in this issue as well as on the chrome-remote-interface github page: https://github.com/cyrus-and/chrome-remote-interface/issues/83
,
Mar 4 2017
Different browser implementations seem to be supporting different methods, rather than a single or at-least compatible API: * [chrome.exe] supports /json endpoint but not /devtools/browser * [chrome.exe --headless] supports /devtools/browser endpoint (and /json on Windows but not on Linux?!) * [headless_shell] supports /devtools/browser endpoint but not /json We'll appreciate some clarity, for coherent development of solutions based on headless. It's also important for a consistent RemoteDebug spec.
,
Mar 4 2017
Correction in my comment (#12) above: * [headless_shell] doesn't support /devtools/browser endpoint (Error: 'Target.createTarget' wasn't found), and doesn't support /json
,
Mar 10 2017
,
Mar 10 2017
,
May 15 2017
,
Jul 25 2017
,
Jul 25 2017
Since the blocker is resolved, I believe json/new should be working in M61, if not earlier builds, too. Regarding #12/13: the browser endpoint should exist in headless. The Target domain doesn't work fully on this endpoint and doesn't exist in non-headless mode yet, bug 697048 tracks this. |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by cyrus....@gmail.com
, Feb 25 2017