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

Support for /json/new #4

Open
jkrems opened this issue Jan 29, 2014 · 6 comments
Open

Support for /json/new #4

jkrems opened this issue Jan 29, 2014 · 6 comments

Comments

@jkrems
Copy link

jkrems commented Jan 29, 2014

Chrome supports the following:

# Open a new blank tab/page
<ANY> /json/new

# Open a new blank tab with a given url
<ANY> /json/new?<url>

I'd like to see this being a <ANY> (Chrome uses it internally as GET but exposes it via any other http verb) so that it's future compatible with things like webdriver-like capability requests in a POST/PUT body.

Expected response is the same schema as one element in the /json-array.

Example request:

> curl -XPOST localhost:3058/json/new\?http://www.google.com
{
   "description": "",
   "devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:3058/devtools/page/5DC5F978-E0B2-7DB4-8962-7CB0AC46AD1A",
   "id": "5DC5F978-E0B2-7DB4-8962-7CB0AC46AD1A",
   "title": "",
   "type": "page",
   "url": "http://www.google.com/",
   "webSocketDebuggerUrl": "ws://localhost:3058/devtools/page/5DC5F978-E0B2-7DB4-8962-7CB0AC46AD1A"
}
@auchenberg
Copy link
Member

Good idea.

Do you know if there's any overview of the Chrome HTTP interface anywhere?

@jkrems
Copy link
Author

jkrems commented Jan 30, 2014

Unfortunately: no idea. For me it was mostly digging through the chromium sources. The following quote is the best starting point for going down the rabbit hole I found (devtools_adb_bridge.cc):

const char kPageListRequest[] = "GET /json HTTP/1.1\r\n\r\n";
const char kVersionRequest[] = "GET /json/version HTTP/1.1\r\n\r\n";
const char kClosePageRequest[] = "GET /json/close/%s HTTP/1.1\r\n\r\n";
const char kNewPageRequest[] = "GET /json/new HTTP/1.1\r\n\r\n";
const char kNewPageRequestWithURL[] = "GET /json/new?%s HTTP/1.1\r\n\r\n";
const char kActivatePageRequest[] =
    "GET /json/activate/%s HTTP/1.1\r\n\r\n";

@auchenberg
Copy link
Member

Interesting, they got /close and /version too!

More stuff to do :)

Kenneth Auchenberg
+45 53 22 22 33

On Thu, Jan 30, 2014 at 11:13 AM, Jan Krems [email protected]:

Unfortunately: no idea. For me it was mostly digging through the chromium
sources. The following quote is the best starting point for going down the
rabbit hole I found (devtools_adb_bridge.cchttps://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/browser/devtools/devtools_adb_bridge.cc
):

const char kPageListRequest[] = "GET /json HTTP/1.1\r\n\r\n";
const char kVersionRequest[] = "GET /json/version HTTP/1.1\r\n\r\n";
const char kClosePageRequest[] = "GET /json/close/%s HTTP/1.1\r\n\r\n";
const char kNewPageRequest[] = "GET /json/new HTTP/1.1\r\n\r\n";
const char kNewPageRequestWithURL[] = "GET /json/new?%s HTTP/1.1\r\n\r\n";
const char kActivatePageRequest[] =
"GET /json/activate/%s HTTP/1.1\r\n\r\n";


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-33674884
.

@DinisCruz
Copy link

I was also trying to find that list, and the best I could do is this (updated link and colour coded) version of the code that implements the exposed methods http://code.woboq.org/qt5/qtwebengine/src/3rdparty/chromium/content/browser/devtools/devtools_http_handler_impl.cc.html#468 (@jkrems devtools_adb_bridge.cc file you linked is not working anymore)

@jkrems
Copy link
Author

jkrems commented Dec 16, 2014

If we are updating this issue: https://github.com/buggerjs/bugger-daemon#api - this is my latest info, includes example response bodies/schemas.

@auchenberg
Copy link
Member

Thanks man! I haven't made any progress, but the plan is to spent more time on this adaptor the next coming months.

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

3 participants