New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 755927 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit 29 days ago
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Headless Chrome: --dump-dom doesn't work

Reported by gembox.j...@gmail.com, Aug 16 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0

Steps to reproduce the problem:
1. Windows 10, Google Chrome Version 60.0.3112.101 (Official Build) (64-bit)
2. Command Prompt, Run as administrator
3. cd "C:\Program Files (x86)\Google\Chrome\Application\"
4. chrome --headless --disable-gpu --screenshot https://www.chromestatus.com/ -> this works, C:\Program Files (x86)\Google\Chrome\Application\60.0.3112.101\screenshot.png was created
6. chrome --headless --disable-gpu --dump-dom https://www.chromestatus.com/ -> this doesn't work. Command prompt doesn't contain any HTML. Some help?
7. Note that --print-to-pdf works, but --repl doesn't work.

What is the expected behavior?
chrome --headless --disable-gpu --dump-dom https://www.chromestatus.com/ should return inner HTML.

What went wrong?
chrome --headless --disable-gpu --dump-dom https://www.chromestatus.com/ doesn't return anything.

Did this work before? No 

Chrome version: 60.0.3112.101  Channel: stable
OS Version: 10.0
Flash Version:
 
cmd.png
19.4 KB View Download

Comment 1 by l...@chromium.org, Aug 16 2017

Components: -Platform>DevTools Internals>Headless
Thanks for the report.  I tried the repro, but DOM was dumped fine on 59.0.3071.115 and 62.0.3187.0.  Forwarding to headless folks, who may know more.

Comment 2 by da...@tuppeny.com, Aug 17 2017

I've tried this on many Windows machines here and none of them worked. It always just quits with no output (--dump-dom, --repl, etc. - all copied from https://developers.google.com/web/updates/2017/04/headless-chrome). Same for screenshots and other things; none of them work.

If I pass a url for a page that connects to a server (eg. opens a web socket), it seems to load the page, opens my web socket and then immediately terminates (the web socket immediately closes after being opened).

Version 60.0.3112.101 (Official Build) (64-bit)

Tried at work and at home, and on several colleagues machines. All Windows 10 (some Pro, some Enterprise), varying hardware (inc. different GPUs).
Thanks for the report. 
Two things: 
1) In Windows you need to enable logging to view stdout
2) You might have permissions problems with running on the Program files. So for screenshot and print-to-pdf command is always advise to indicate an output directory, in the form --screenshot=c:\tmp\out.png

For instance, with Chrome Canary installed, I've verified that this command works: 

"%USERPROFILE%\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --headless  http://example.com --enable-logging --dump-dom

Note that the blog post was written when only linux support was offered.

Owner: dvallet@chromium.org
Status: WontFix (was: Unconfirmed)
I have tried your proposal and it doesn't work with 60.0.3112.101 (stable), but it works with Canary. 

I think that using Canary version will be ok for us. Thank you for the help!

Sign in to add a comment