[Bug 219188] www/chromium support for --headless flag

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 219188] www/chromium support for --headless flag

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219188

            Bug ID: 219188
           Summary: www/chromium support for --headless flag
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: [hidden email]
          Reporter: [hidden email]
          Assignee: [hidden email]
             Flags: maintainer-feedback?([hidden email])

I want to use chrome with the --headless flag on a server without an X server
running to get screenshots and/or print-to-pdf of a page.

Without running a display server, chrome errors out immediately because GTK can
not open the display.

root@FreeBSD:~ # echo $DISPLAY
DISPLAY: Undefined variable.
root@FreeBSD:~ # chrome --headless --disable-gpu --no-sandbox --screenshot
--verbose http://example.com
[81628:457269248:0510/101444.736930:ERROR:browser_main_loop.cc(284)] Gtk:
cannot open display:

---

When I try running it with xvfb.

root@FreeBSD:~ # service dbus onestart
root@FreeBSD:~ # Xvfb :0 -screen 0 1024x768x24 &
root@FreeBSD:~ # setenv DISPLAY :0
root@FreeBSD:~ # chrome --version
Chromium 58.0.3029.81
root at FreeBSD:~ # chrome --headless --disable-gpu --no-sandbox --screenshot
--verbose http://example.com

This seems to just hang (runs on the command line without any output).
My guess is that chrome is droping the --headless flag and going ahead and
initializing as if it were running on an actual system

---

On a debian system with chromium (57.0.2987) installed from the package
repository, the command seems to run without an X sever (even xvfb) running
beforehand.

root@debian:~# apt-get install chromium
...
root@debian:~# chromium --version
Chromium 57.0.2987.98 Built on 8.7, running on Debian 8.7
root@debian:~# chromium  --headless --disable-gpu --screenshot --verbose
http://example.com
[0507/071136.814541:WARNING:audio_manager.cc(321)] Multiple instances of
AudioManager detected
[0507/071136.814714:WARNING:audio_manager.cc(278)] Multiple instances of
AudioManager detected
[0507/071137.002908:INFO:headless_shell.cc(378)] Screenshot written to file
screenshot.png.


The command exits without error and the screenshot.png file is in the folder
where the command ran from.

---

Some reference links:
- https://developers.google.com/web/updates/2017/04/headless-chrome
- https://chromium.googlesource.com/chromium/src/+/master/headless/README.md
- https://chromium.googlesource.com/chromium/src/+/58.0.3029.81/headless/

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-chromium
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

maintainer-feedback requested: [Bug 219188] www/chromium support for --headless flag

bugzilla-noreply
Reshad Patuck <[hidden email]> has reassigned Bugzilla Automation
<[hidden email]>'s request for maintainer-feedback to
[hidden email]:
Bug 219188: www/chromium support for --headless flag
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219188



--- Description ---
I want to use chrome with the --headless flag on a server without an X server
running to get screenshots and/or print-to-pdf of a page.

Without running a display server, chrome errors out immediately because GTK can
not open the display.

root@FreeBSD:~ # echo $DISPLAY
DISPLAY: Undefined variable.
root@FreeBSD:~ # chrome --headless --disable-gpu --no-sandbox --screenshot
--verbose http://example.com
[81628:457269248:0510/101444.736930:ERROR:browser_main_loop.cc(284)] Gtk:
cannot open display:

---

When I try running it with xvfb.

root@FreeBSD:~ # service dbus onestart
root@FreeBSD:~ # Xvfb :0 -screen 0 1024x768x24 &
root@FreeBSD:~ # setenv DISPLAY :0
root@FreeBSD:~ # chrome --version
Chromium 58.0.3029.81
root at FreeBSD:~ # chrome --headless --disable-gpu --no-sandbox --screenshot
--verbose http://example.com

This seems to just hang (runs on the command line without any output).
My guess is that chrome is droping the --headless flag and going ahead and
initializing as if it were running on an actual system

---

On a debian system with chromium (57.0.2987) installed from the package
repository, the command seems to run without an X sever (even xvfb) running
beforehand.

root@debian:~# apt-get install chromium
...
root@debian:~# chromium --version
Chromium 57.0.2987.98 Built on 8.7, running on Debian 8.7
root@debian:~# chromium  --headless --disable-gpu --screenshot --verbose
http://example.com
[0507/071136.814541:WARNING:audio_manager.cc(321)] Multiple instances of
AudioManager detected
[0507/071136.814714:WARNING:audio_manager.cc(278)] Multiple instances of
AudioManager detected
[0507/071137.002908:INFO:headless_shell.cc(378)] Screenshot written to file
screenshot.png.


The command exits without error and the screenshot.png file is in the folder
where the command ran from.

---

Some reference links:
- https://developers.google.com/web/updates/2017/04/headless-chrome
- https://chromium.googlesource.com/chromium/src/+/master/headless/README.md
- https://chromium.googlesource.com/chromium/src/+/58.0.3029.81/headless/
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-chromium
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 219188] www/chromium support for --headless flag

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219188

Carlos J. Puga Medina <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[hidden email]        |[hidden email]
                 CC|                            |[hidden email]

--- Comment #1 from Carlos J. Puga Medina <[hidden email]> ---
Created attachment 182480
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=182480&action=edit
patch

- Add initial headless support

The initial support has not implemented --print-to-pdf command because they are
working on it.

https://codereview.chromium.org/2829973002/
https://bugs.chromium.org/p/chromium/issues/detail?id=603559

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-chromium
To unsubscribe, send any mail to "[hidden email]"