Headless Chromium
Headless Chromium allows running Chromium in a headless/server environment. Expected use cases include loading web pages, extracting metadata (e.g., the DOM) and generating bitmaps from page contents -- using all the modern web platform features provided by Chromium and Blink.
As of M118, precompiled headless_shell
binaries are available for download under the name chrome-headless-shell
via Chrome for Testing infrastructure.
As of M132, headless shell functionality is no longer part of the Chrome binary, so --headless=old has no effect. If you are using old Headless functionality you should now migrate to chrome-headless-shell
. Read more.
There are two ways to use Headless Chromium:
Usage via the DevTools remote debugging protocol
Start Chrome in headless mode using the
--headless
command line flag:
Navigate to
chrome://inspect/
in another instance of Chrome.
Usage from Node.js
For example, the chrome-remote-interface Node.js package can be used to extract a page's DOM like this:
Alternatvely, the Puppeteer Node.js package can be used to communicate with headless, for example:
Resources and Documentation
Mailing list: [email protected]
Bug tracker: Internals>Headless
File a new bug (bit.ly/2pP6SBb)