Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2017 10:18:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 219188] www/chromium support for --headless flag
Message-ID:  <bug-219188-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219188

            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: chromium@FreeBSD.org
          Reporter: reshadpatuck1@gmail.com
          Assignee: chromium@FreeBSD.org
             Flags: maintainer-feedback?(chromium@FreeBSD.org)

I want to use chrome with the --headless flag on a server without an X serv=
er
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:=20

---

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=20
root at FreeBSD:~ # chrome --headless --disable-gpu --no-sandbox --screensh=
ot
--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/

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-219188-13>