Consider replacing headless_shell runtime switches with a nodejs module + exemplary application |
|||
Issue descriptionFolks are starting to rely on headless_shell switches, such as --screenshot and --print-to-pdf, that are intended only to provide examples for the use of DevTools APIs. It's difficult for users to extend the functionality surrounding these switches with e.g. custom options passed to the DevTools commands. As a result, we receive requests from developers to add more command line flags to expose such options. We should consider replacing the exemplary life-cycle that headless_shell implements (setting sizes, waiting for page load, grabbing a screenshot, etc.) as a nodejs module (+ example app) that is more easily customizable to developers' needs. The C++ parts of headless_shell then no longer need to support exemplary command line options, such as --screenshot / --print-to-pdf / --dom-dump. Instead, an exemplary page load/life cycle that supports such functionality will be provided in the new nodejs module.
,
May 9 2017
The library proposed here would use chrome's remote debugging protocol [1] via websockets to interact with headless chrome. That's the primary API surface for interacting with headless chrome (and doesn't require compiling chromium). See some examples for using this API in the context of headless here [2]. [1] https://chromedevtools.github.io/devtools-protocol/ [2] https://developers.google.com/web/updates/2017/04/headless-chrome#node
,
May 9 2017
After Google I/O, DevRel would like to write up some recipes that use Node (possibly other languages) with the protocol to accomplish common tasks. I think there are a bunch of things we can show off, as well as community articles and samples. eseckler@ feel free to ping if you have ideas on what to include.
,
May 9 2017
#3: Cool! I think there's been a lot of attention around screenshots (particularly of the whole page) and pdf generation. Automated testing is probably another big one. Sounds like collecting such recipes / common tasks and maybe including them in the proposed library & app might be a good idea :)
,
May 9 2017
Screenshots, definitely. For those following, screenshots using headless appear to be buggy atm: https://bugs.chromium.org/p/chromium/issues/detail?id=714058
,
May 9 2017
An example written in Python for me would be of great help.
,
May 15 2017
,
Sep 21 2017
It feels like with Puppeteer there no longer really a need for us to provide Node.js examples anymore. It would still be nice to trim down headless_shell a bit, but it's probably not that urgent anymore. Does that sound right?
,
Sep 21 2017
Yeah, I agree. Puppeteer is practically said nodejs library :)
,
Sep 21 2017
Agree here. And I imagine Eric's cool with this as well. I'll close.
,
Sep 21 2017
OK, filed bug 767346 for the trimming down of headless_shell.
,
Sep 21 2017
Yes, Puppeteer ftw! |
|||
►
Sign in to add a comment |
|||
Comment 1 by bna...@gmail.com
, May 9 2017