multiple tabs?

1,141 views
Skip to first unread message

isaac....@gmail.com

unread,
Jun 29, 2016, 2:53:39 AM6/29/16
to headless-dev
Hello,
Author of the gcd library here (https://github.com/wirepair/gcd). I'm currently testing out the headless dev branch for running large scale scanning/analysis of the web. Right now I use pools of browser tabs, but it appears the headless chrome does not support this, is this correct? I ask because attempting to do a http://127.0.0.1:9222/json/new to create a new tab returns a 500, "Could not create new page." 
Thanks!
-Isaac

Alex Clarke

unread,
Jun 29, 2016, 5:44:13 AM6/29/16
to isaac....@gmail.com, headless-dev
Hi we're planning on adding some new commands to DevTools protocol for managing tabs, which should let you do what you want.  I don't have an ETA but I hope to get to this soon.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/dc00ef78-3200-4789-b5b6-8772ec58a8f2%40chromium.org.

isaac....@gmail.com

unread,
Jun 29, 2016, 6:54:26 AM6/29/16
to headless-dev, isaac....@gmail.com
Awesome, thanks for the quick response. Will this change be global for devtools or just the headless branch? 

Sami Kyostila

unread,
Jun 29, 2016, 7:37:31 AM6/29/16
to isaac....@gmail.com, headless-dev
I think we want to make this available for everyone. The headless version might accept a few more arguments about what type of tab to create, but in basic tab opening and closing should be possible in all versions.

- Sami

Alex Clarke

unread,
Jul 7, 2016, 5:15:21 AM7/7/16
to Isaac Dawson, headless-dev
We've just landed some new Browser domain DevTools commands to manage tabs and browser contexts:
  • Browser.createBrowserContext
    • Creates an empty browser context, this is a bit like an incognito profile except you can have as many as you like
  • Browser.disposeBrowserContext
    • Deletes an unused context
  • Browser.createTarget
    • Creates a new tab, you can specify the initial url, the window dimensions and a browser context
  • Browser.closeTarget
    • Closes a devtools target, if that target is a tab then the tab gets closed too
Hopefully those will prove useful!


Alex Clarke

unread,
Jul 7, 2016, 5:54:07 AM7/7/16
to Isaac Dawson, headless-dev
I should probably mention you can access the Browser domain over WebSockets via  /devtools/browser in addition to /devtools/page/guid.
Reply all
Reply to author
Forward
0 new messages