I want to use Chrome browser in headless mode to produce images (PNG, JPEG) out of SVG graphic. Code works in normal interactive mode, but I have problems to use it in headless mode.
My main problem is that headless Chrome exits before drawing of HTML page is completed. As I understand, if I start Chrome with following arguments:
chromium --headless http://myserver.org
It exits together with document.onload event. But at this moment not all data fetched from the server (I using XMLHttpRequest) and therefore drawing is not complete.
I found workaround if I start chrome with debugging port enabled like:
chromium --headless --remote-debugging-port=7777 http://myserver.org
But this is not that I want, especially when I do not have privileges
to open http ports on the node. Is there possibility to let Chrome
running longer with other flags?
I check a lot of them, but did not found appropriate one. Or is there any other methods to postpone exit of the headless Chrome?
I found slightly better workaround with --remote-debugging-socket-fd=0, but it does not work on Windows. And still it is not a solution for the problem.
--
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/509691c6-de7f-4825-9bfd-3f390ea8a2cf%40chromium.org.
You can also start headless with --remote-debugging-pipe, which should keep it alive as well. Not sure if this works under Windows though. If you want to interact with headless, you'll still need to use devtools either way, and --remote-debugging-port=X is the suggested way of doing that. Maybe you could run headless_shell in a VM or container so that you can get access to a port?
--
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/9afcffff-7a60-4b6b-8876-a65d3771cb83%40chromium.org.
From what I can tell, --remote-debugging-pipe should work on windows, too. Did you try?
--
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/c7ce9edb-8e25-4a2a-8912-c47b390d44eb%40chromium.org.